The Area of Spherical Triangles

Though the formula I discovered which gives the area of a triangle on the surface of the unit sphere looks rather complicated, it really isn't if you understand the steps that went into it. You just need to get a picture in your mind of what's going on and you can see how the formula works. This page explains a little bit of the thinking I went through to come up with the formula. If you can follow it, you can see that it doesn't rely on any partucular insights into mathematics, but only an idea of the way to do various things. Making the formula was just like putting together a machine; it's like engeneering. Incedentally, my professor said I wouldn't be able to do it, but I did!

The problem to solve is this: given three points on a sphere's surface ♣, ♥, and ♠, what is the area of the triangle drawn on the sphere's surface, with those points as its corners? Since the surface of a sphere is curved, triangles drawn on it will work differently than they normally do. Here's how I solved it:

The total area of a unit sphere is 4 π, so a hemisphere will be 2 π, and any straight line drawn on the sphere will divide it into two hemispheres. When two lines intersect at an angle θ (in radians, that is, distance around a circle of radius 1) they divide the circle into 4 regions of areas 2 θ and 2 (1 - θ). (Regions on opposite sides of the sphere have the same areas.)

Now, imagine three lines on a sphere which form a triangle. Suppose the triangle's corners has angles θ, φ, and ρ. (On a sphere, unlike on a plane, two of a triangle's angles do not determine the third angle. On a sphere the angles of a triangle will always add up to something more than π.) If you extend the sides of the triangles all the way around the sphere, you will find that they devide the sphere into 8 regions, and that regions on opposite sides have the same area. If the triangle whose area you want to measure is A, the region touching the side opposite angle θ is B, the region touching the side opposite angle φ is C, and the region touching the side opposite angle ρ is D, you find that:

A + B == 2 θ,  A + C == 2 φ,  A + D == 2 ρ,  A + B + C + D == 2 π

The first three equations follow from the way two intersecting lines on a sphere divide the area of the sphere, and the last equation follows from the fact that the four regions cover half the entire area of the sphere. This is best illustrated by drawing a picture, which you'll have to do yourself, because I don't feel like it.

A bit of algebra with these equations leads one to this formula:

A == θ + ρ + φ - π

Thus we have the area of a triangle on a sphere given its angles.

How do we get the angles though, if the only given information is the location of the corners of the triangle? The basic idea is this: if two curves intersect at a point, the angle of their intersection is the same as the angle of intersection of their tangent lines at that point. In this case, the curves are the sides of the triangle; therefore I must find tangents to these curves wherever they touch ♣, ♥, and ♠. This is not difficult. If I want to find a tangent line at point ♣ along the circle from ♣ to ♥, the formula ♣ + ♣ × (♣ × ♥), where × is the cross product, will give me a point on that tangent. Here is another place where drawing a picture on your own will be helpful.

Now that I have points on the tangent lines, how can I find the angle at which they meet? This can be done using the law of cosines, which states that for all triangles of sides a, b, and c and angle α opposite a:

a^2 == b^2 + c^2 - 2 b c Cos[α]

The triangle we'll be using this on will be the one formed by the point on the sphere, and the points on the tangent lines on the curves going to the other two points. Since there are three points, we'll use the law of cosines three times in the final formula. Since we want to find an angle, we must solve for α:

α == ArcCos[(b^2 + c^2 - a^2)/(2 b c)]

Now I have gathed all the tools that are needed. All that remains is to put them together. In the case of point ♣, the other two points on the triangle will be ♣ + ♣ × (♣ × ♥) and ♣ + ♣ × (♣ × ♠). Therefore a, b, and c in the formula above will be given by mag[♣ × (♣ × ♥)], mag[♣ × (♣ × ♠)], and  mag[♣ × (♣ × ♥) - ♣ × (♣ × ♠)]where mag denotes the magnetude of a vector. Therefore, putting these into the formula from the law of cosines, and putting those into the formula for the triangle's area gives:

ArcCos[(mag[♣ × (♣ × ♥)]^2 - mag[♣ × (♣ × ♥) - ♣ × (♣ × ♠)]^2 + mag[-♣ × (♣ × ♠)]^2)/(2 mag[♣ × (♣ × ♥)] mag[-♣ × (♣ × ♠)])] + ArcCos[(mag[-♥ × (♥ × ♣)]^2 + mag[♥ × (♥ × ♠)]^2 - mag[-♥ × (♥ × ♣) + ♥ × (♥ × ♠)]^2)/(2 mag[-♥ × (♥ × ♣)] mag[♥ × (♥ × ♠)])] + ArcCos[(mag[♠ × (♠ × ♣)]^2 - mag[♠ × (♠ × ♣) - ♠ × (♠ × ♥)]^2 + mag[-♠ × (♠ × ♥)]^2)/(2 mag[♠ × (♠ × ♣)] mag[-♠ × (♠ × ♥)])] - π

And there you have it!



More Mathematica coolness!!!

The reason I worked on this problem is that part of the predictions for a physics experiment I'm doing for class involves finding the proportion of a sphere that a rectangular detector can see. Since a rectangle is just two triangles, this formula can be used to find the area of it. Imagine that, at the center of a sphere, a rectangle is being projected straight up onto the inside of the sphere. This rectangular projection on the x axis makes an angle θ with the vertical, and on the y axis makes an angle φ. Therefore, where z=1, the corners of the rectangle will be at

{Tan[θ], Tan[φ], 1} {-Tan[θ], Tan[φ], 1} {Tan[θ], -Tan[φ], 1} {-Tan[θ], -Tan[φ], 1}

However, I only need 3 of the points for a triangle; I can then just multiply the answer by two. So I'll drop the last point on that list. However, these points need to be on the unit circle, and in this case they only are if θ and φ are zero. This can be fixed with the following function UnitVector that I made. It takes a vector and returns a new vector in the same direction but of magnetude 1.

UnitVector[&: _List] := &:/Plus @@ &:^2^(1/2)

Using this function on the first three points from the list above gives:

Out[94]=

{Tan[θ]/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2), Tan[φ]/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2), 1/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2)}
{-Tan[θ]/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2), Tan[φ]/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2), 1/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2)}
{Tan[θ]/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2), -Tan[φ]/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2), 1/(1 + Tan[θ]^2 + Tan[φ]^2)^(1/2)}

Using my spherical triangle formula above with these three points and multiplying by two gives the enormous formula below:

Out[92]=

2 (-π + ArcCos[((4 Tan[θ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 - (4 Tan[θ]^4)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + (4 Tan[φ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 - (4 Tan[θ]^4 Tan[φ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + (4 Tan[φ]^4)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + (4 Tan[θ]^2 Tan[φ]^4)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + (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]^2 + Tan[φ]^2)^(3/2))^2 - (-(2 Tan[θ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2) + (2 Tan[φ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2))^2 + ((2 Tan[θ])/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2) + (2 Tan[θ] Tan[φ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2))^2 - ((2 Tan[θ])/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2) + (4 Tan[θ] Tan[φ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2))^2)/(2 ((4 Tan[φ]^4)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + (4 Tan[θ]^2 Tan[φ]^4)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + ((2 Tan[φ])/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2) + (2 Tan[θ]^2 Tan[φ])/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2))^2)^(1/2) ((4 Tan[θ]^4)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + (4 Tan[θ]^4 Tan[φ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^3 + ((2 Tan[θ])/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2) + (2 Tan[θ] Tan[φ]^2)/(1 + Tan[θ]^2 + Tan[φ]^2)^(3/2))^2)^(1/2))])

However, using the Mathematica function Simplify on this gives the much more elegant formula:

Out[93]=

2 (-π + ArcCos[-(Sin[φ]^2 (Sec[φ]^2 Tan[θ]^2)/(Sec[φ]^2 + Tan[θ]^2)^2^(1/2))/(Sec[θ]^2 Tan[φ]^2)/(Sec[φ]^2 + Tan[θ]^2)^2^(1/2)] + ArcCos[(Cos[φ]^2 (Sec[φ]^2 Tan[θ]^2)/(Sec[φ]^2 + Tan[θ]^2)^2^(1/2))/(Tan[θ]^2 + Tan[φ]^2)/(Sec[φ]^2 + Tan[θ]^2)^2^(1/2)] + ArcCos[(Cos[θ]^2 (Sec[θ]^2 Tan[φ]^2)/(Sec[φ]^2 + Tan[θ]^2)^2^(1/2))/(Tan[θ]^2 + Tan[φ]^2)/(Sec[φ]^2 + Tan[θ]^2)^2^(1/2)])

God I love Mathematica!!! Isn't it amazing how it'll do all that for you? Anytime you want to know the area of a rectangular projection from the center of a sphere onto a unit sphere, you can just use this.


Converted by Mathematica  (April 25, 2003)