Mercurial > forge
changeset 9152:3dc6192a829a octave-forge
mechanics: Fixing docstrings
author | jpicarbajal |
---|---|
date | Fri, 09 Dec 2011 14:39:23 +0000 |
parents | 85dc6dab4c46 |
children | 124d8bcb100a |
files | main/mechanics/inst/core/inertiamoment.m main/mechanics/inst/core/masscenter.m |
diffstat | 2 files changed, 10 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/main/mechanics/inst/core/inertiamoment.m Fri Dec 09 14:30:20 2011 +0000 +++ b/main/mechanics/inst/core/inertiamoment.m Fri Dec 09 14:39:23 2011 +0000 @@ -15,14 +15,14 @@ %% -*- texinfo -*- %% @deftypefn {Function File} { @var{Iz} =} inertiamoment (@var{pp}, @var{m}) -%% Moment of intertia of a plane shape. +%% Moment of intertia of a plane shape. %% %% Calculates the moment of inertia respect to an axis perpendicular to the %% plane passing through the center of mass of the body. %% %% The shape is defined with piecewise smooth polynomials. @var{pp} is a -%% cell where each elements is a 2-by-(poly_degree+1) matrix containing px(i,:) = -%% pp{i}(1,:) and py(i,:) = pp{i}(2,:). +%% cell where each elements is a 2-by-(poly_degree+1) matrix containing +%% @code{px(i,:) =pp{i}(1,:)} and @code{py(i,:) = pp{i}(2,:)}. %% %% @seealso{masscenter, principalaxis} %% @end deftypefn @@ -39,11 +39,11 @@ px = x(1,:); py = x(2,:); - + paux = conv (px, px)/3 + conv(py, py); paux2 = conv (px, polyderiv (py)) ; P = polyint (conv (paux, paux2)); - + %% Faster than quad dI = diff(polyval(P,[0 1])); @@ -72,4 +72,3 @@ %! -1.715729 6.715729 0 -5]}; %! Iz = inertiamoment (circle,1); %! assert (Iz, 0.5*5^2, 5e-3); -
--- a/main/mechanics/inst/core/masscenter.m Fri Dec 09 14:30:20 2011 +0000 +++ b/main/mechanics/inst/core/masscenter.m Fri Dec 09 14:39:23 2011 +0000 @@ -15,11 +15,11 @@ %% -*- texinfo -*- %% @deftypefn {Function File} { @var{cm} =} masscenter (@var{pp}) -%% Center of mass of a plane shape. +%% Center of mass of a plane shape. %% %% The shape is defined with piecewise smooth polynomials. @var{pp} is a -%% cell where each elements is a 2-by-(poly_degree+1) matrix containing px(i,:) = -%% pp{i}(1,:) and py(i,:) = pp{i}(2,:). +%% cell where each elements is a 2-by-(poly_degree+1) matrix containing +%% @code{px(i,:) = pp{i}(1,:)} and @code{py(i,:) = pp{i}(2,:)}. %% %% @seealso{inertiamoment} %% @end deftypefn @@ -29,7 +29,7 @@ cm = sum( cell2mat ( cellfun (@CMint, shape, 'UniformOutput', false))); A = shapearea(shape); cm = cm / A; - + endfunction function dcm = CMint (x) @@ -38,7 +38,7 @@ py = x(2,:); Px = polyint (conv(conv (px , px)/2 , polyderiv (py))); Py = polyint (conv(-conv (px , px)/2 , polyderiv (px))); - + dcm = zeros (1,2); dcm(1) = diff(polyval(Px,[0 1])); dcm(2) = diff(polyval(Py,[0 1])); @@ -68,4 +68,3 @@ %! -1.715729 6.715729 0 -5]}; %! CoM = masscenter (circle); %! assert (CoM , [0 0], 5e-3); -