Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
compute surface area within closed loop on sphere

Subject: compute surface area within closed loop on sphere

From: Peter Schreiber

Date: 7 Jan, 2013 06:12:09

Message: 1 of 2

Dear all,
I have a closed loop on a sphere and would like to compute the surface area enclosed within the closed loop. I don't have an analytical expression for the curve (closed loop) on the sphere surface.

How would I go about calculating the surface area?

Best Regards,
Peter

Subject: compute surface area within closed loop on sphere

From: Roger Stafford

Date: 8 Jan, 2013 20:22:09

Message: 2 of 2

"Peter Schreiber" <schreiber.peter15@gmail.com> wrote in message <kcdovp$lo7$1@newscl01ah.mathworks.com>...
> I have a closed loop on a sphere and would like to compute the surface area enclosed within the closed loop. I don't have an analytical expression for the curve (closed loop) on the sphere surface.
> How would I go about calculating the surface area?
- - - - - - - - - -
  Let p0 = [x0,y0,z0] be a point on the sphere's surface preferably interior to the closed loop, and let P1 be an n x 3 array of coordinates of your discrete closed loop points, where we suppose that the sphere has its center at the origin and radius R. (If the center is not at the origin, subtract it from p0 and P1.) Then you can break up the region inside the loop into n spherical triangles where p0 is always one vertex and two successive points on P1 are the other two vertices. For each triangle you can use Lhuillier's formula to compute its surface area. Their sum will then give you the total area. The following code provides a signed area for each triangle in order to allow triangles to cancel out that may have overlapped due to the nature of the P1 curve. Consequently P1 should make a net total of one loop around p0 in a counterclockwise direction in order to obtain a
positive result.

 P0 = repmat(p0,size(P1,1),1);
 P2 = P1([2:end,1],:);
 P01 = atan2(sqrt(sum(cross(P0,P1,2).^2,2)),dot(P0,P1,2));
 P12 = atan2(sqrt(sum(cross(P1,P2,2).^2,2)),dot(P1,P2,2));
 P20 = atan2(sqrt(sum(cross(P2,P0,2).^2,2)),dot(P2,P0,2));
 S = (P01+P12+P20)/2;
 A = R^2*sum( sign(dot(P0,cross(P1,P2,2),2)) .* ...
  (4*atan(sqrt(tan(S/2).*tan((S-P01)/2).*tan((S-P12)/2).*tan((S-P20)/2)))) );

A is the area.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us