Spherical Triangle

Author

Eric W. Weisstein
January 27, 2011

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Trigonometry/SphericalTriangle.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/SphericalTriangle.html.

©2010 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Graphics`Shapes`
<<Utilities`LiveGraphics3D`

(*line[a_List]:=Line[Append[a,a[[1]]]]*)
p1=20 Degree; t1=130 Degree;
p2=95 Degree; t2=-30 Degree;
arc=GreatCircleArc[{Cos[t1]Sin[p1],Sin[t1]Sin[p1],Cos[p1]},{Cos[t2]Sin[p2],Sin[t2]Sin[p2],Cos[p2]}];
tri=SphericalTriangle[1.1,1.4,.9];

Great Circle

WriteLiveForm["greatcir.m",Show[Graphics3D[{{GrayLevel[.5],Sphere[1,15,15]/.Polygon->Line2},{Thickness[.01],arc}}],Boxed->False]]

Great Circle Distances

km2miles=1000 100/2.54/12/5280;
r=6378 km2miles;

cart[l_,p_]:={Cos[l]Cos[p],Sin[l]Cos[p],Sin[p]}

GreatCircle[{lat1_,phi1_},{lat2_,phi2_}]:=Module[
  {p1=phi1 Degree,
  p2=phi2 Degree,
  l1=lat1 Degree,
  l2=lat2 Degree},
  r ArcCos[Cos[p1]Cos[p2]Cos[l1-l2]+Sin[p1]Sin[p2]]//N
]

StraightLine[{lat1_,phi1_},{lat2_,phi2_}]:=Module[
  {v=cart@@({lat1,phi1}Degree)-cart@@({lat2,phi2}Degree)},
  r Sqrt[v.v]//N
]

LA-Honolulu

LA:={34+3/60+15/3600,118+14/60+28/3600}
Honolulu:={21+18/60+22/3600,157+51/60+35/3600}

{GreatCircle[LA,Honolulu],StraightLine[LA,Honolulu]}

Gailord Gordon

{GreatCircle@@#,StraightLine@@#}&[{{156,21},{122,38}}]

Spherical Triangle

?SphericalTriangle

Bigger filesize

WriteLiveForm["sphertri.m",
Show[Graphics3D[{
{GrayLevel[.5],Wireframe[Flatten[Sphere[1,15,15]]]},
(*{RGBColor[0,0,1],tri[[1,1]]}, *)
{RGBColor[1,0,0],tri[[1,2]],Thickness[.01],Rest[tri[[1,3]]]}
},Boxed->False]]
]

Smaller filesize

WriteLiveForm["sphertri.m",
Show[Graphics3D[{
{GrayLevel[.5],Sphere[1,15,15]/.Polygon->line},
(*{RGBColor[0,0,1],tri[[1,1]]}, *)
{RGBColor[1,0,0],tri[[1,2]],Thickness[.01],Rest[tri[[1,3]]]}
},Boxed->False]]
]