[math-fun] Spherical polygon area
Belatedly answering D.Wilson, given vertices as a list of {latitude,longitude} pairs, the (unit sphere) area is: xyz[{\[Phi]_,\[Theta]_}]:={Cos[\[Theta]]*Cos[\[Phi]],Sin[\[Theta]]*Cos[\[Phi]],Sin[\[Phi]]} Spharea[latlongs_List] := Total[MapThread[ Function[{\[Phi]\[Theta]1, \[Phi]\[Theta]2, \[Phi]\[Theta]3}, ArcCos[normcross[\[Phi]\[Theta]1, \[Phi]\[Theta]2].normcross[\ \[Phi]\[Theta]3, \[Phi]\[Theta]2]]], {RotateRight[latlongs], latlongs, RotateLeft[latlongs]}]] - Pi*(Length[latlongs] - 2) normcross[\[Phi]\[Theta]1_, \[Phi]\[Theta]2_] := Normalize[Cross[xyz[\[Phi]\[Theta]1], xyz[\[Phi]\[Theta]2]]] which coincides with a plan suggested by "Ask Dr. Math", if you Google the subject line. Testing on David's equator-based trapezoid of width a and height b, paired with the rest of the polar triangle of width a, so that their areas sum to a: In[121]:= FullSimplify[{Spharea[{{0, 0}, {0, a}, {b, a}, {b, 0}}], Spharea[{{b, 0}, {b, a}, {Pi/2, foobar}}]}, 0 < a < Pi && 0 < b < Pi/2] where foobar, as everyone knows, is the longitude of the North Pole, Out[121]= {ArcSin[(2*Sin[a/2]*Sin[b])/Sqrt[3 + Cos[a] + (-1 + Cos[a])*Cos[2*b]]] - ArcSin[((-1 + Cos[a])*Sin[b])/ Sqrt[Cos[b]^2*Sin[a]^2 - 2*(-1 + Cos[a])*Sin[b]^2]], a - ArcCos[-((2*Sin[a/2]*Sin[b])/ Sqrt[3 + Cos[a] + (-1 + Cos[a])*Cos[2*b]])] + ArcCos[(2*Sin[a/2]^2*Sin[b])/ Sqrt[Cos[b]^2*Sin[a]^2 - 2*(-1 + Cos[a])*Sin[b]^2]]} Unfortunately, Mma chose to write -1 + Cos[a] for the trapezoid but 2*Sin[a/2]^2 for the triangle! And it is completely incapable of simplifying down to a unless we help it: In[133]:= {#, TrigReduce[#]}&[2*Sin[a/2]^2]*Sin[b] Out[133]= {2*Sin[a/2]^2*Sin[b], (1 - Cos[a])*Sin[b]} In[143]:= FullSimplify[Total[%121] /. Rule @@ %133] Out[143]= a --rwg
participants (1)
-
Bill Gosper