# User:NorwegianBlue/area of a square on the surface of a sphere

Jump to: navigation, search

## Initial presentation of the problem

how do one find the area of a square drawn on a sphere?

Simple answer, you cant, a square is 2D and a sphere is 3D, so you can not draw a square on a sphere. Stefan 09:38, 24 May 2006 (UTC)
It might be better to say that a sphere is a surface (a two dimensional Riemannian manifold) with constant positive curvature, while the plane is a surface (two dimensional manifold) with constant zero curvature. ---CH 10:03, 24 May 2006 (UTC)
Well there's a way to do triangles (it's in my friends multivariable calculus book), but I dunno about squares. --M1ss1ontomars2k4 (T | C | @) 03:48, 25 May 2006 (UTC)
So.. why don't you just divide that square in two triangles .. and add up the results?

as in an object with 4 sides, and their interior angle does not add up to 360 degrees. HOw do you find the area?

See Theorema egregium. ---CH 10:03, 24 May 2006 (UTC)
If you are asking how to find the area of some shape on a sphere, then perhaps we can give you a helpful answer - but in order to do so, you have todefine the shape 'exactly'. For example we could start analysing the area of a square projected onto the surface of a sphere. This isn't a square, it has curved edges. So back to you... -- SGBailey 10:25, 24 May 2006 (UTC)
BTW, did you know that an equilateral "triangle" on a sphere touching the points lat=0,long=0; lat=0,long=90; lat=90,long=any has three 90 degree corners and has an area of 1/8 of the sphere? -- SGBailey 10:25, 24 May 2006 (UTC)
You will have to express the sides of the "square" mathmatically to determine the boundaries of the double integral that will give you the area. You will probably want to solve it in spherical coordinates. You are going to have to know some calculus for this one. --Swift 11:11, 24 May 2006 (UTC)

actually, the whole thing goes like this, i am tryin' the find the area of this...

A square with the side of 10 cm, and draw loci (10cm) on each corners (quarter of a circle in a square to give the "square")

This is NOT a homework question, i just want a head start of what to do. If you do not understand what i said, tell me and i'll create an image from Paint. many thanks!

I do not understand! OK one more 'simple' answer to your to 'simple' question, between a very very very small bit more than 100 square cm to about maybe 200 square cm.
A little bit more complicated answer, as I see it this can not be answered with the data you have given, the answer depends on the radius of the sphere. If the radius of the sphere is 'close' to infinity the area will be very close to 100 square cm, if the radius of the sphere is as small as it can be (I think sqrt(50)) before the sphere 'fall' through the square it will be around maybe 150-200 square cm. But again you do not want 'simple' answers, to get a real answer you need to give more info. I guess what you want is not a answer, but a formula f(r,s)=..... where r is the radius of the sphere and s is the side of the 'square' and the result is the area of the 'square'. But sorry I will not even try to do that math. :-) (maybe I should learn wikipedia math symbols instead ....) Stefan 14:33, 24 May 2006 (UTC)
According to Square (geometry), a hemispere would be a valid "squareon a sphere" with side length = 0.25*sphere circumference and area=0.5*sphere area. Indeed presumably a hemisphere is an instance of every regular polygon with the same area and side length = 1/N * circumference. I note that this is a "valid" (?) 2 sided polygon and even a valid (?) one sided polygon! -- SGBailey 16:12, 24 May 2006 (UTC)
I don't get this. Perhaps drawing that picture would help clear things up. --Swift 08:33, 25 May 2006 (UTC)

Is this about spherical geometry?Yanwen 20:58, 24 May 2006 (UTC)

Excuse me if I'm missing something obvious here, but M1ss1ontomars2k4 says: Well there's a way to do triangles (it's in my friends multivariable calculus book), but I dunno about squares. So, find the area of a right-angled triangle (or sphere-surfaced equivalent) with shorter sides both length 10cm, and double it. Grutness...wha? 05:46, 25 May 2006 (UTC)

Grutness, You are missing something. On a sphere triangles etc don't scale like that. -- SGBailey 11:59, 25 May 2006 (UTC)

Yes user:grutness is sort of right - but what is missing is the radius of the sphere otherwise answers will have to be expressed as a function of radius. Take the solid angle created by half the 'square' ie a spherical triangle - double it and multiply by r squared to get the surface area. Spherical trigonometry may help as will solid angle - see continued talk below Wikipedia:Reference desk/Science#(continued) Area on a sphereHappyVR 16:42, 27 May 2006 (UTC)

adoroph

## Followup on science section

This is the problem. It's not a homework question and I just need to know how to work it out. Length of the square is 10 cm, find the shaded area (the curved lines are the loci of the 4 corners)

As you just want to know how to do it, I will not carry out actual calculations. Call A, B, C, D the vertices of the square in a clockwise fashion starting from the bottom left one. Let E be the top point of intersection between the four circumferences, and let F be the right one. Then one can show that the segments AE subtends pi/6and AF divide the right angle BAD into three equal angles, each of them measuring ${\displaystyle \pi /6}$. Hence, if you set up Cartesian cohordinates so that A=(0,0), B=(0,1), C=(1,1) and D=(1,0), the x-cohordinate of F is just sin(${\displaystyle \pi /6}$)=${\displaystyle {\sqrt {3}}/2}$. The equation of the circumference centered in A being ${\displaystyle x^{2}+y^{2}=1}$, the area you are looking for is ${\displaystyle 4\int _{1/2}^{{\sqrt {3}}/2}{\sqrt {1-x^{2}}}-1/2dx}$ (using symmetry to simplify things). Cthulhu.mythos 14:48, 26 May 2006 (UTC)

That's quite funny. There's a much easier way to figure this out. I won't give the details just in case it is homework, but the approach looks like this: let a be the area coloured yellow area, and b be the area of one of the four curvy arrowhead-like shapes in the corners. Express the area of the whole square in terms of a and b. Express the area of a quarter circle in terms of a and b. This gives you simultaneous equations in a and b which you can easily solve for a. Gdr 15:33, 26 May 2006 (UTC)

Your method doesn't account for all the areas. In addition to "a" and "b" there are is also the pointy area between two "b" areas. 199.201.168.100 15:37, 26 May 2006 (UTC)

Yes, you're quite right. So call the thin area at the side c and make three simultaneous equations in a, b and c. Gdr 15:55, 26 May 2006 (UTC)

There's certainly a way to avoid calculus. It's easy enough to get the cartesian coordinates of the four vertices of the yellow area. (e.g. the top one is at (1/2, sqrt(3)/2) just because it makes an equilateral triangle with the bottom two vertices of the main square.) Then take the yellow area to be a square joining its four vertices (aligned diagonal to the coordinate axes), plus four vaguely lens-shape pieces. The area of each of the lens-shape pieces is obtained by considering drawing straight lines connecting its two vertices to the opposite corner (i.e. to the center of the arc): it's the area of the sector of the circle minus the area of the triangle. Hope this makes some kind of sense. Arbitrary username 20:56, 26 May 2006 (UTC)
Like the person posing the question, I am not a mathematician. I suspect that the responses so far have not given enough practical detail to be helpful to the questioner. Based on the original question, and on this repost, I'll have a go at reformulating what I think the questioner had in mind: We are working on the surface of a sphere. We have two pairs of great circles. The angle between the first pair of great circles, expressed in radians, is 10cm/r, where r is the radius of the sphere. The angle between the second pair of great circles is equal to the angle between the first pair. The plane defined by the axes corresponding to the first pair of great circles is perpendicular to the plane defined by the axes corresponding to the second pair of great circles. At two opposite locations on the surface of the sphere, "squares" are formed, as illustrated in the image. Is it possible to express the area of one of these "squares" analytically, such that the area tends to 100cm2 as r tends to infinity? --NorwegianBlue 21:26, 26 May 2006 (UTC)
• I love math problems that have multiple approaches. I'll wave my hands a bit and assert that the corners of the yellow area cut the arcs in thirds. Call A the yellow corner on the left, and B the one on top. Construct segment AB. Figure out the area between segment AB and arc AB, and add four of 'em to a square of side AB. I think the result will look something like
${\displaystyle (2R\sin {\frac {\pi }{12}})^{2}+(2R^{2}({\frac {\pi }{6}}-\sin {\frac {\pi }{6}}))}$
but that's only because I looked up the formulas for the circular segment on mathworld.
Signed, math degree 30 years ago next month and am rusty as all hell. --jpgordon∇∆∇∆ 05:41, 27 May 2006 (UTC)
• The question was related to the area of a square on the surface of a sphere, and the preceding answer appears to be plane geometry (correct me if I'm wrong!). I think we can be reasonably sure that this is not a homework question, because of the vague way in which it was formulated. I believe what the questioner had in mind was the area illustrated in yellow here:

The red curves are supposed to represent great circles.
Is anybody able to come up with a formula for the yellow area in terms of r, the radius of the sphere? Also, it would be nice if the person that posed the question confirmed that this is what he/she is looking for. --NorwegianBlue 09:19, 27 May 2006 (UTC)

• Oh, it doesn't matter what they're looking for -- this is fun! Probably belongs over in WP:RD/Math. I ignored the sphere thing, for some reason or another. But isn't there insufficient information to calculate this? (Is this a solid angle on a sphere?)--jpgordon∇∆∇∆ 16:13, 27 May 2006 (UTC)
Yes it is a solid angle of a sphere type question - the missing info. is the radius r of the sphere - without that answers will need to be functions of r. By the way if the interior angles of a triangle drawn on a sphere are a,b and c then the solid angle covered by the triangle (spherical geometry here) is a+b+c-pi in steradians. HappyVR 16:32, 27 May 2006 (UTC)
My question, and possibly the original poster's question, was if somebody could provide a formula for the area, in terms of r. --NorwegianBlue 16:43, 27 May 2006 (UTC)

## Followup on maths section

This question was originally posted in the science section, but belongs here. The original questioner has stated clearly that it is not a homework question. It was formulated as follows:

"How do one find the area of a square drawn on a sphere? A square with the side of 10 cm, and draw loci (10cm) on each corners (quarter of a circle in a square to give the "square")"

Based on the discussion that followed, I think what the questioner had in mind is the area illustrated in yellow in the drawing below:

The red circles are supposed to be two pairs of great circles. The angle between the first pair of great circles, expressed in radians, is 10cm/R, where R is the radius of the sphere. The angle between the second pair of great circles is equal to the angle between the first pair. The plane defined by the axes corresponding to the first pair of great circles is perpendicular to the plane defined by the axes corresponding to the second pair of great circles.

The question is how to express the yellow area in terms of R, the radius of the sphere. Obviously, as R ? 8, the area ? 100 cm2.

• -

I am not a mathematician, but felt that it "ought to" be possible to express this area in terms of R, and decided to try to find the necessary information.

I found Girard's theorem, which states that the area of a triangle on a sphere is (A + B + C - p) × R2, where A, B and C are the angles between the sides of the triangle, as illustrated in the second drawing. I also found the law of sines for triangles on a sphere, which relates the angles A, B and C to the angles a, b and c which define the sides of the triangle
${\displaystyle {\frac {\sin a}{\sin A}}={\frac {\sin b}{\sin B}}={\frac {\sin c}{\sin C}}.}$

I then attempted to divide the square into two triangles, and compute the area of one of these, but am stuck because I don't know the diagonal. Since this is spherical geometry, I doubt that it is as simple as ${\displaystyle {\sqrt {2}}\times 10cm}$. I would appreciate if somebody told me if I am on the right track, and, if so, how to complete the calculations. If my presentation of the problem reveals that I have misunderstood some of the theory, please explain. --NorwegianBlue 14:11, 28 May 2006 (UTC)

The natural way I suspect the question should presumably be answered is to take the square on the flat plane and use Jacobians to transform it onto the sphere. Those with a firmer grip of analysis would probably want to fill in the details at this point... Dysprosia 15:28, 28 May 2006 (UTC)
An easier way to tackle this might be to exploit the symetry of the situation. Slice the sphere into 4 along z=0 and x=0. This will give four identical squares with four right angles and two sides of length 5. The cut the squares along x+z=0, x-z=0 giving eight triangles, each with one 45 degree angles, one right angle and one side of length 5. --Salix alba (talk) 15:44, 28 May 2006 (UTC)
I think vibo is on the right track. You can use the law of sines to calculate the length of the diagonal. -lethe talk + 15:44, 28 May 2006 (UTC)
The law of cosines for spherical trig gives cos c = cos2 a. -lethe talk + 16:06, 28 May 2006 (UTC)
From which I get using the spherical law of sines that sin A = sin a/ v(1 – cos4 a). A = B and C = p/2, so I have the triangle, and hence the square. -lethe talk + 16:11, 28 May 2006 (UTC)
To lethe: How can you say that C = p/2? This is spherical geometry, and the four "right" angles in the "square" in the first drawing add up to more than 2p, don't they, or am I missing something? --NorwegianBlue 16:49, 28 May 2006 (UTC)
You may be right, I cannot assume that the angles are right angles. Let me mull it over some more. -lethe talk + 16:58, 28 May 2006 (UTC)
OK, I think the right assumption to make is that C = 2A. I can solve this triangle as well, but it's quite a bit messier. Lemme see if I can clean it up, and then I'll post it. -lethe talk + 17:20, 28 May 2006 (UTC)
This makes my final answer
${\displaystyle 2R^{2}\left(2\sin ^{-1}\left({\frac {\sin a}{\sqrt {1-\cos ^{4}a}}}\right)-{\frac {\pi }{2}}\right)}$
For the square. Now I just have to see whether this answer works. -lethe talk + 16:14, 28 May 2006 (UTC)
And now I'm here to tell you that Mathematica assures me that this function approaches s2 as the curvature goes to zero. From the series, I can say that to leading two orders of correction, area = s2 + s4/6R2 + s6/360R4. -lethe talk + 16:25, 28 May 2006 (UTC)
I got the following for the diagonal angle c of the big square from "first principles" (just analytic geometry in 3D): cos(c/2) = 1 / sqrt(1+2t2), where a = 10cm/R and t = tan(a/2). --LambiamTalk 16:02, 28 May 2006 (UTC)
I'm afraid I didn't understand (I'm not a mathematician :-) ). If we let (uppercase) C be the "right" (i.e. 90°+something) angle in the triangle in the second figure, and (lowercase) c be the diagonal that we are trying to calculate, could you please show the steps leading to this result (or rephrase it, if I misinterpreted your choice of which of the angles A,B,C that was the "right" one)? --NorwegianBlue 18:07, 28 May 2006 (UTC)
For simplicity, let's put R = 1, since you can divide all lengths first by R, and multiply the area afterwards by R2. Then the equation of the sphere is x2 + y2 + z2 = 1. Take the point nearest to the spectator in the first image to be (x,y,z) = (0,0,1), so z decreases when receding. Take the x-axis horizontal and the y-axis vertical. A grand circle is the intersection of a plane through the sphere's centre (0,0,0) with the sphere. The equation of the plane that gives rise to the grand circle whose arc segment gives the top side of the "square" is y = tan(a/2) × z = tz (think of it as looking sideways along the x-axis). At the top right corner of the "square" we have x = y. Solving these three equations (sphere, plane, x = y) for z, using z > 0, gives us z = 1 / sqrt(1+2t2). Now if c is the angle between the rays from the centre of the sphere to this corner and its opposite (which, if R = 1, is also the length of the diagonal), so c/2 is the angle between one of these rays and the one through (0,0,1), then z = cos(c/2). Combining this with the other equation for z gives the result cos(c/2) = 1 / sqrt(1+2t2). Although I did not work out the details, I think you can combine this with Salix alba's "cut in eight" approach and the sines' law to figure out the missing angle and sides. --LambiamTalk 19:59, 28 May 2006 (UTC)

### new calculation

As vibo correctly points out above, the square will not have right angles, so my calculation is not correct. Here is my new calculation. Assuming all angles of the square are equal, label this angle C. Then draw the diagonal, and the resulting triangle will be equilateral with sides a and angles A, and 2A = C. The law of sines tells me

${\displaystyle {\frac {\sin a}{\sin A}}={\frac {\sin c}{\sin 2A}}\,\!}$

from which I have

${\displaystyle \sin c=2\cos A\sin a.\,\!}$

From the law of cosines I have that

${\displaystyle \cos c=\cos ^{2}a+\sin ^{2}a(2\cos ^{2}A-1).\,\!}$

My goal here is to eliminate c. First I substitute cos A:

${\displaystyle \cos c=\cos ^{2}+\sin ^{2}a\left({\frac {\sin ^{2}c}{2\sin ^{2}a}}-1\right)\,\!}$

which reduces to the quadratic equation

${\displaystyle \cos ^{2}c+2\cos c-1=2\cos 2a.\,\!}$

So I have

${\displaystyle \cos c=-1\pm {\sqrt {2+2\cos 2a}}\,\!}$

and using cos A = sin c/2sin a, I am in a position to solve the triangle

${\displaystyle A=\cos ^{-1}\left({\frac {1}{2}}{\sqrt {1-\left(-1+{\sqrt {2+2\cos 2a}}\right)^{2}}}\csc a\right).\,\!}$

I'm pretty sure this can be simplified quite a bit, but the simplification I got doesn't agree with the one Mathematica told me. Anyway, the expansion also has the right limit of s2. -lethe talk + 20:16, 28 May 2006 (UTC)

Despite the figure, which is only suggestive (and not quite correct), are we agreed on the definition of a "square on a sphere"? The question stipulates equal side lengths of 10 cm. To avoid a rhombus we should also stipulate equal interior angles at the vertices, though we do not have the luxury of stipulating 90° angles. Food for thought: Is such a figure always possible, even on a small sphere? (Suppose the equatorial circumference of the sphere is itself less than 10 cm; what then?) Even if it happens that we can draw such a figure, is it clear what we mean by its area? Or would we prefer to stipulate a sufficiently large sphere? (If so, how large is large enough?) Figures can be a wonderful source of inspiration and insight, but we must use them with a little care. --KSmrqT 20:40, 28 May 2006 (UTC)
The figure was drawn by hand, and is obviously not quite correct, but doesn't the accompanying description:
The red circles are supposed to be two pairs of great circles. The angle between the first pair of great circles, expressed in radians, is 10cm/R, where R is the radius of the sphere. The angle between the second pair of great circles is equal to the angle between the first pair. The plane defined by the axes corresponding to the first pair of great circles is perpendicular to the plane defined by the axes corresponding to the second pair of great circles.
resolve the ambiguity with respect to the rhombus, provided that the area of the square is less than half of the area of the sphere? --NorwegianBlue 21:51, 28 May 2006 (UTC)
What is meant by "the angle between the … circles"? That's not really the same as the arclength of a side as depicted. Also note that the orginal post suggests that the side might be a quarter of a circle. If that is true, then the "square" is actually a great circle! Each angle will be 180°, and the area "enclosed" will be a hemisphere of a sphere with radius 20 cm/π, namely 2π(20 cm/π)2 = 800 cm2/π, approximately 254.65 cm2.
By a series of manipulations I came up with
${\displaystyle \cos ^{2}A={\frac {\cos a}{1+\cos a}},}$
where a is 10 cm/R, the side length as an angle. The angle of interest is really C = 2A, for which
${\displaystyle \cos C=-\tan ^{2}{\frac {a}{2}}.}$
For the hemisphere case, a = π/2 produces C = π; while for the limit case, a = 0 produces C = π/2.
The original question was about the area, so we should conclude with that: (4C-2π)R2. --KSmrqT 04:43, 29 May 2006 (UTC)
By "the angles between a pair of great circles", I meant the angle between the plane P1 in which the first great circle lies, and the plane P2 in which the second great circle lies. The arc length depicted was intended to represent the intersection between the surface of the sphere, and a plane P3, which is orthogonal to P1 and P2, and which passes through the centre of the sphere. As previously stated, I have little mathematical training. I therefore made a physical model by drawing on the surface of a ball, before making the first image. I convinced myself that such a plane is well-defined, and that this length of arc on a unit sphere would be identical to the angle between P1 and P2. Please correct me if I am mistaken, or confirm if I am right. --NorwegianBlue 20:19, 29 May 2006 (UTC)
Every great circle does, indeed, lie in a well-defined plane through the center of the sphere. Between two such planes we do have a well-defined dihedral angle. The problem arises when we cut with a third plane. If we cut near where the two planes intersect we get a short arc; if we cut far from their intersection we get a longer arc. In other words, the dihedral angle between the two planes does not determine the arclength of the "square" side.
Instead, use the fact that any two distinct points which are not opposite each other on the sphere determine a unique shortest great circle arc between them, lying in the plane containing the two points and the center. Our value a is the angle between the two points, as measured at the center of the sphere. Were we to pick two opposite points, we'd have a = π, which is half the equatorial circumference of a unit sphere. For a sphere of radius R, the circumference is 2πR. We are told that the actual distance on the sphere is exactly 10 cm, but we are not told the sphere radius. The appearance of the "square" depends a great deal on the radius, and so does its area. When the radius is smaller, the sides "bulge out" to enclose more area, the corner angles are greater, and the sphere bulges as well. As the sphere radius grows extremely large, the square takes up a negligible portion of the surface, the sides become straighter, the angles approach perfect right angles, and the sphere bulges little inside the square.
We do not have a handy rule for the area of a square on a sphere. Luckily, the area of a triangle on a sphere follows a powerful and surprisingly simple rule, based on the idea of angular excess. Consider a triangle drawn on a unit sphere, where the first point is at the North Pole (latitude 90°, longitude irrelevant), the second point drops straight down onto the equator (latitude 0°, longitude 0°), and the third point is a quarter of the way around the equator (latitude 0°, longitude 90°). This triangle has three perfect right angles for a total of 270° (or 3π/2), and encloses exactly one octant — one eighth of the surface area — of the sphere. The total surface area is 4π, so the triangle area is π/2. This area value is exactly the same as the excess of the angle sum, 3π/2, compared to a flat right triangle, π. The simple rule is, this is true for any triangle on a unit sphere. If instead the sphere radius is R, the area is multipled by R2.
Thus we simplify our area calculation by two strategies. First, we divide out the effect of the radius so that we can work on a unit sphere. Second, we split the "square" into two equal halves, two equilateral triangles, by drawing its diagonal. Of course, once we find the triangle's angular excess we must remember to double the value (undoing the split) and scale up by the squared radius (undoing the shrink).
Notice that this mental model assumes the sphere radius is "large enough", so that at worst the square becomes a circumference. We still have not considered what we should do if the sphere is smaller than that. It seems wise to ignore such challenges for now. --KSmrqT 21:23, 29 May 2006 (UTC)
Thank you. I really appreciate your taking the time to explain this to me which such detail and clarity. --NorwegianBlue 23:34, 29 May 2006 (UTC)

### Coordinate Transform

What if we perform a simple coordinate transform to spherical coordinates and perform a 2-dimensional integral in phi and theta (constant r = R). Then, dA = r^2*sin(theta)*dphi*dtheta, and simply set the bounds of phi and theta sufficient to make the lengths of each side 10 cm. Nimur 18:11, 31 May 2006 (UTC)

### Calculation completed

Thanks a million to the users who have put a lot of work in explaining this to me, and in showing me the calculations necessary. I started out based on the work of lethe. Armed with a table of trigonometric identities, I went carefully through the calculations, and am happy to report that I feel that I understood every single step. I was not able to simplify the last expression much further, the best I can come up with is

${\displaystyle \cos A={\frac {1}{2}}\csc a{\sqrt {2{\sqrt {2+2\cos 2a}}-2\cos 2a-2}}\,.\!}$
You should probably make use of the identity
${\displaystyle \cos 2a=2\cos ^{2}a-1}$
here, it simplifies this expression quite a bit. -lethe talk + 02:01, 30 May 2006 (UTC)

Since the r.h.s. is based on a only, which is a known constant when the radius and length of arc are given (a=10cm/R for the given example), let us substitute ${\displaystyle G=g(a)\,\!}$ for the r.h.s. Note that the function is undefined at a=0°±180° because of the sine function in the denominator. There is a graph of g(a) on my user page.

We can now calculate the area of the triangle, and that of the square.

${\displaystyle \cos A=G.\,\!}$
${\displaystyle \cos 2A=2\cos ^{2}A-1=2G^{2}-1\,.\!}$

According to Girard's formula, we then have

${\displaystyle area_{triangle}=(A+B+C-\pi )\times R^{2}\!}$
${\displaystyle area_{triangle}=\left(2\cos ^{-1}G+\cos ^{-1}(2G^{2}-1)-\pi \right)\times R^{2}\!}$
${\displaystyle area_{square}=2\times \left(2\cos ^{-1}G+\cos ^{-1}(2G^{2}-1)-\pi \right)\times R^{2}\!}$

I calculated the behaviour of this area function on a unit sphere when a is in the range (0°...180°):

Seems reasonable up to 90°. The value at 90° corresponds to the "square" with four corners on a great circle that KSmrq mentions above, i.e. to a hemisphere, and the area, 2p is correct. in the interval [90°..180°), the function returns the smaller of the two areas. I also notice that the function looks suspiciously elliptical. Are we computing a much simpler function in a roundabout way?

I next studied how the formula given by KSmrq works out:

${\displaystyle area_{triangle}=\left(2\cos ^{-1}\left({\sqrt {\frac {\cos a}{1+\cos a}}}\,\right)+\cos ^{-1}(-\tan ^{2}{\frac {a}{2}})-\pi \right)\times R^{2}\!}$
${\displaystyle area_{square}=2\times \left(2\cos ^{-1}\left({\sqrt {\frac {\cos a}{1+\cos a}}}\,\right)+\cos ^{-1}(-\tan ^{2}{\frac {a}{2}})-\pi \right)\times R^{2}\!}$

I computed the area, and found that in the range (0°..90°], the formulae of lethe and KSmrq yield identical results, within machine precision. Above 90°, the formula of KSmrq leads to numerical problems (nans).

Finally, I would like to address the question of the orignial anonymous user who first posted this question on the science desk. Let us see how the area of the square behaves as R increases, using 10 cm for the length of arc in each side of the "square". The smallest "reasonable" value of R is 20cm/p ˜ 6.366 cm, which should lead to a surface area of approximately 254.65 cm2, as KSmrq points out. Driven by curiosity, I will start plotting the function at lower values than the smallest reasonable one (in spite of KSmrq's advice to "ignore such challenges for now").

Here is the graph:

Unsurprisingly, the function behaves weirdly below the smallest reasonable value of R, but from R ˜ 6.366 cm and onwards, the function behaves as predicted, falling rapidly from 254.65 cm2, and approaching 100 cm2 asymptotically. In case anybody is interested in the calculations, I have put the program on my user page.

Again, thank you all. --NorwegianBlue 23:54, 29 May 2006 (UTC)

Well done. It does appear that you overlooked my simple formula for the area, which depends on C alone. Recall that when the square is split, the angle A is half of C, so the sum of the angles is A+A+C, or simply 2C. This observation applies to User:lethe's results as well, where we may use simply 4A. So, recalling that a = 10 cm/R, a better formula is
 ${\displaystyle \mathrm {area} _{\mathrm {square} }\,\!}$ ${\displaystyle {}=\left(4\cos ^{-1}(-\tan ^{2}{\frac {a}{2}})-2\pi \right)\times R^{2}\,\!}$ ${\displaystyle {}=\left(4\cos ^{-1}(-\tan ^{2}{\frac {10\ \mathrm {cm} }{2R}})-2\pi \right)\times R^{2}.\,\!}$
For the arccosine to be defined, its argument must be between -1 and +1, and this fails when the radius goes below the stated limit. (A similar problem occurs with the formula for A, where a quantity inside a square root goes negative.) Both algebra and geometry are telling us we cannot step carelessly into the domain of small radii. Try to imagine what shape the "square" may take when the circumference of the sphere is exactly 10 cm; both ends of each edge are the same point! Not only do we not know the shape, we do not know what to name and measure as the "inside" of the square.
This raises an important general point about the teaching, understanding, and application of mathematics. Statements in mathematics are always delimited by their range of applicability. Every function has a stated domain; every theorem has preconditions; every proof depends on specific axioms and rules of inference. Once upon a time, we manipulated every series with freedom, with no regard to convergence; to our chagrin, that sometimes produced nonsense results. Once it was supposed that every geometry was Euclidean, and that every number of interest was at worst a ratio of whole numbers; we now make regular use of spherical geometry and complex numbers. When we state the Pythagorean theorem, we must include the restriction of the kind of geometry in which it applies. When we integrate a partial differential equation, the boundary conditions are as important as the equation itself. It is all too easy to fall into the careless habit of forgetting the relevance of limitations, but we do so at our peril. --KSmrqT 02:36, 30 May 2006 (UTC)
Yes, I did overlook the (now painfully obvious) fact that the sum of the angles was 2C. Your final point is well taken. I understood that the reason for the NaN's was a domain error, but thanks for pointing out the exact spots. --NorwegianBlue 19:40, 30 May 2006 (UTC)

## Supplementary material

### Graph of the function g(a)

lethe provided the following function for cos A, where A=B represents half of the "right" (i.e. 90°+something) angle C in a "square" on the surface of a sphere.

${\displaystyle \cos A={\frac {1}{2}}\csc a{\sqrt {2{\sqrt {2+2\cos 2a}}-2\cos 2a-2}}\,.\!}$

Since the r.h.s. is based on a only, which is a known constant when the radius and length of arc are given (a=10cm/R for the example that prompted my follow-up question), I will substitute ${\displaystyle G=g(a)\,\!}$ for the r.h.s. Note that the function is undefined at a=0°±180° because of the sine function in the denominator. The graph of g(a) looks like this:

The function appears to approach ${\displaystyle {\frac {1}{2}}{\sqrt {2}}}$ as a approaches 180°, as well as when a approaches 0° from above.

### Computations

Here is the program that was used for the calculations referred to:

   #include <iostream>
#include <math.h>
&bnsp;
const double PI = 3.1415926535897932384626433832795;
void ErrorExit(const char* msg, int lineno)
{
std::cerr << msg << " program line: " << lineno << '\n';
exit(2);
}
// __________________________________________________
//
double csc(double arg)
{
double s = sin(arg);
if (s == 0)
{
ErrorExit("Division by zero attempted!", __LINE__);
}
return 1.0/s;
}
// __________________________________________________
//
double pow2(double arg)
{
return arg*arg;
}
// __________________________________________________
//
double g_lethe(double a)
{
return 0.5*csc(a)*sqrt(2.0*sqrt(2.0 + 2.0*cos(2.0*a)) - 2.0*cos(2.0*a) - 2.0);
}
// __________________________________________________
//
double area_lethe(double a)
{
double G = g_lethe(a);
return 2*(2*acos(G) + acos(2*pow2(G)-1)-PI);
}
// __________________________________________________
//
double area_ksmrq(double a)
{
return 2*(2*acos(sqrt(cos(a)/(1.0+cos(a)))) + acos(-pow2(tan(a/2.0)))-PI);
}
// __________________________________________________
//
int main()
{
std::cout << "Calculating G as a function of a" << '\n';
std::cout << "=================================\n\n";
int i;
for (i = -90; i <= 540; ++i)
{
double a = static_cast<double>(i)*PI/180.0;
// Cheating a little to avoid division by zero
if (i == 0)
{
a += 0.0001;
}
else if (i == 360)
{
a -= 0.0001;
}
double G = g_lethe(a);
std::cout << i << "; " << G << '\n';
}
&bnsp;
std::cout << "\n\n\n";
std::cout << "Calculating area of square in a unit sphere as a function of a" << '\n';
std::cout << "===============================================================\n\n";
&bnsp;
for (i = 0; i <= 180; ++i)
{
double a = static_cast<double>(i)*PI/180.0;
if (i == 0)
{
// Cheating a little to avoid division by zero
a += 0.0001;
}
else if (i == 180)
{
// Cheating a little because of the discontinuity at 180 degrees
a -= 0.0001;
}
double S = area_lethe(a);
double T = area_ksmrq(a);
std::cout << i << "; " << S << "; " << T << '\n';
}
std::cout << "\n\n\n";
std::cout << "Calculating area of square with 10cm side as a function of R" << '\n';
std::cout << "=============================================================\n\n";
//
for (i = 10; i < 2000; ++i)
{
double R = 0.1*static_cast<double>(i)/PI;
double a = 10.0/R;
double S = area_lethe(a)*pow2(R);
std::cout << R << "; " << S << '\n';
}
return 0;
}



### Info from KSmrq which was commented out

By a series of manipulations I came up with
${\displaystyle \cos ^{2}A={\frac {\cos a}{1+\cos a}},}$
where a is 10 cm/(2πR), the side length as an angle. The angle of interest is really C = 2A, for which
${\displaystyle \cos C=-\tan ^{2}{\frac {a}{2}}.}$
For the hemisphere case, a = π/2 produces C = π; while for the limit case, a = 0 produces C = π/2.

Calculations (best done privately)
The idea of the derivation is to start with the haversine formula for C, noting that we have an equilateral triangle so the first term vanishes. Thus, noting C = 2A,
${\displaystyle \mathrm {haversin} \ c=\sin ^{2}a\,\mathrm {haversin} \ 2A,\,\!}$
or, noting haversin z = 12versin z = 12(1-cos z),
${\displaystyle 1-\cos c=(1-\cos 2A)\sin ^{2}a,\,\!}$
or, noting cos 2A = 2cos2 A-1,
${\displaystyle \cos c=1-2\sin ^{2}A\,\sin ^{2}a.\,\!}$
We also have, as lethe observed,
${\displaystyle \sin c=2\cos A\sin a.\,\!}$
Now we can eliminate c using the fundamental trigonometric identity, and eliminate both sin2 A and sin2 a as well. We obtain a quadratic equation in x = cos2 A and y = cos a,
${\displaystyle (y^{2}-1)x^{2}+(-2y^{2})x+(y^{2})=0.\,\!}$
No doubt a cleaner way to this simple solution exists, but this may suffice.