Home > matGeom > geom3d > ellipsoidSurfaceArea.m

ellipsoidSurfaceArea

PURPOSE ^

ELLIPSOIDSURFACEAREA Approximated surface area of an ellipsoid.

SYNOPSIS ^

function s = ellipsoidSurfaceArea(elli)

DESCRIPTION ^

ELLIPSOIDSURFACEAREA  Approximated surface area of an ellipsoid.

   S = ellipsoidSurfaceArea(ELLI)
   Computes an approximation of the surface area of an ellipsoid. 
   ELLI is a 1-by-9 row vector given by [XC YC ZC A B C THETA PHI PSI],
   where (XC YC ZC) is the center, (A B C) is the length of each semi axis
   and (THETA PHI PSI) representes the orientation.
   If ELLI is a 1-by-3 row vector, it is assumed to contain only the
   lengths of semi-axes.

   This functions computes an approximation of the surface area, given by:
   S = 4 * pi * ( (a^p * b^p + a^p * c^p + b^p * c^p) / 3) ^ (1/p)
   with p = 1.6075. The resulting error should be less than 1.061%.

   Example
   ellipsoidSurfaceArea

   See also
   geom3d, ellipsePerimeter, oblateSurfaceArea, prolateSurfaceArea

   References
   * http://en.wikipedia.org/wiki/Ellipsoid
   * http://mathworld.wolfram.com/Ellipsoid.html

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function s = ellipsoidSurfaceArea(elli)
0002 %ELLIPSOIDSURFACEAREA  Approximated surface area of an ellipsoid.
0003 %
0004 %   S = ellipsoidSurfaceArea(ELLI)
0005 %   Computes an approximation of the surface area of an ellipsoid.
0006 %   ELLI is a 1-by-9 row vector given by [XC YC ZC A B C THETA PHI PSI],
0007 %   where (XC YC ZC) is the center, (A B C) is the length of each semi axis
0008 %   and (THETA PHI PSI) representes the orientation.
0009 %   If ELLI is a 1-by-3 row vector, it is assumed to contain only the
0010 %   lengths of semi-axes.
0011 %
0012 %   This functions computes an approximation of the surface area, given by:
0013 %   S = 4 * pi * ( (a^p * b^p + a^p * c^p + b^p * c^p) / 3) ^ (1/p)
0014 %   with p = 1.6075. The resulting error should be less than 1.061%.
0015 %
0016 %   Example
0017 %   ellipsoidSurfaceArea
0018 %
0019 %   See also
0020 %   geom3d, ellipsePerimeter, oblateSurfaceArea, prolateSurfaceArea
0021 %
0022 %   References
0023 %   * http://en.wikipedia.org/wiki/Ellipsoid
0024 %   * http://mathworld.wolfram.com/Ellipsoid.html
0025 %
0026 
0027 % ------
0028 % Author: David Legland
0029 % e-mail: david.legland@grignon.inra.fr
0030 % Created: 2012-02-24,    using Matlab 7.9.0.529 (R2009b)
0031 % Copyright 2012 INRA - Cepia Software Platform.
0032 
0033 %% Parse input argument
0034 
0035 if size(elli, 2) == 9
0036     a = elli(:, 4);
0037     b = elli(:, 5);
0038     c = elli(:, 6);
0039     
0040 elseif size(elli, 2) == 3
0041     a = elli(:, 1);
0042     b = elli(:, 2);
0043     c = elli(:, 3);    
0044 end
0045 
0046 p = 1.6075;
0047 s = 4 * pi * ( (a.^p .* b.^p + a.^p .* c.^p + b.^p .* c.^p) / 3) .^ (1 / p);

Generated on Wed 16-Feb-2022 15:10:47 by m2html © 2003-2019