SphericalAngle[{θ0,ϕ0}{{θ1,ϕ1},{θ2,ϕ2}}]
gives the signed angle in radians between the great circles through point {θ0,ϕ0} and points {θ1,ϕ1} and {θ2,ϕ2}.
SphericalAngle[p{q,r}]
gives the unsigned angle for points p, q, r of the form {θ1,θ2,…,θn-1,ϕ} on an n-dimensional hypersphere.
SphericalAngle[p{{q1,r1},…,{qn,rn}}]
gives a list of angles between the great circles from point p through points qi and ri.
SphericalAngle[{p1,…,pn}{{q1,r1},…,{qn,rn}}]
gives a list of angles between the great circles from point pi through points qi and ri.
SphericalAngle
SphericalAngle[{θ0,ϕ0}{{θ1,ϕ1},{θ2,ϕ2}}]
gives the signed angle in radians between the great circles through point {θ0,ϕ0} and points {θ1,ϕ1} and {θ2,ϕ2}.
SphericalAngle[p{q,r}]
gives the unsigned angle for points p, q, r of the form {θ1,θ2,…,θn-1,ϕ} on an n-dimensional hypersphere.
SphericalAngle[p{{q1,r1},…,{qn,rn}}]
gives a list of angles between the great circles from point p through points qi and ri.
SphericalAngle[{p1,…,pn}{{q1,r1},…,{qn,rn}}]
gives a list of angles between the great circles from point pi through points qi and ri.
Details
- Spherical or hyperspherical coordinate vectors use the same conventions of CoordinateChartData and CoordinateTransformData, but with the leading r coordinate dropped.
- The angle between great circles is measured in radians, and it does not depend on spherical or hyperspherical radius.
- The spherical case is orientable, so a signed angle is returned. The hyperspherical case is non-orientable without additional input, so an unsigned angle is returned.
- The sign convention is positive counterclockwise around the normal passing through point p.
- Points on a 2D sphere can also be specified using GeoPosition[{lat,lon}] notation, with latitudes and longitudes in degrees.
- When working with numerical data, SphericalAngle does not accept complex-valued inputs and returns only real-valued outputs.
Examples
open all close allBasic Examples (4)
Compute the angle between polar great circles:
SphericalAngle[{0, 0} -> {{Pi / 3, 0}, {Pi / 4, Pi / 4}}]Find the angle between a pair of geodesics on the 3-sphere:
SphericalAngle[{0.52, 0.63, 0.78} -> {{1.38, 0.94, 0.43}, {1.05, 1.57, 3.14}}]Perform a symbolic computation:
SphericalAngle[{0, 0} -> {{a, b}, {c, d}}]Simplify the result assuming a typical range of values:
Simplify[%, {0 < a < Pi, 0 < c < Pi}]Calculate 10 random angles on a 4-sphere, all centered around one chosen point:
SphericalAngle[{0, 0, 0, 0} -> RandomReal[Pi, {10, 2, 4}]]Scope (3)
Calculate a symbolic angle between arbitrary points on a sphere:
SphericalAngle[{a, b} -> {{c, d}, {e, f}}]Calculate the angle around a tetrahedron vertex using 30 digits of precision:
Take[PolyhedronData["Tetrahedron", "VertexCoordinates"], 3]{q, p, r} = N[Rest /@ ToPolarCoordinates[%], 30]SphericalAngle[p -> {q, r}]% - 2Pi / 3SphericalAngle also accepts GeoPosition latitude-longitude coordinates:
{q, p, r} = GeoPosition /@ {Entity["City", {"Chicago", "Illinois", "UnitedStates"}], Entity["City", {"Atlanta", "Georgia", "UnitedStates"}], Entity["City", {"Dallas", "Texas", "UnitedStates"}]}GeoGraphics[GeoPath[{q, p, r}], GeoRange -> Entity["Country", "UnitedStates"]]SphericalAngle[p -> {q, r}] / DegreeApplications (1)
Define three points bounding a spherical octant:
{q, p, r} = {{Pi / 2, 0}, {0, 0}, {Pi / 2, Pi / 2}}Compute the interior angle at each vertex:
angles = SphericalAngle /@ {p -> {q, r}, p -> {q, r}, q -> {r, p}}Verify that the sum of these angles minus π equals an eighth of the area of the unit sphere:
With[{sphereArea = 4Pi},
SameQ[Total[angles] - Pi, sphereArea / 8]]Properties & Relations (3)
GeoDirection computes an angle from the North Pole on an ellipsoidal model of the Earth:
GeoDirection[Entity["City", {"Madrid", "Madrid", "Spain"}], Entity["City", {"Paris", "IleDeFrance", "France"}]]Compute a similar angle on a sphere:
SphericalAngle[GeoPosition[Entity["City", {"Madrid", "Madrid", "Spain"}]] -> {{0, 0}, GeoPosition[Entity["City", {"Paris", "IleDeFrance", "France"}]]}] / DegreeForce GeoDirection to use a spherical model of the Earth:
GeoDirection[GeoPosition[Entity["City", {"Madrid", "Madrid", "Spain"}]["Coordinates"], 1], GeoPosition[Entity["City", {"Paris", "IleDeFrance", "France"}]["Coordinates"], 1]]Approximate the area of the Bermuda Triangle:
{b1, b2, b3} = GeoPosition /@ {
Entity["City", {"SanJuan", "SanJuan", "PuertoRico"}]["Coordinates"], Entity["City", {"Miami", "Florida", "UnitedStates"}]["Coordinates"], Entity["City", {"Hamilton", "Hamilton", "Bermuda"}]["Coordinates"]};GeoGraphics[Polygon[{b1, b2, b3}]]angles = SphericalAngle[{b1 -> {b3, b2}, b3 -> {b2, b1}, b2 -> {b1, b3}}](Total[angles] - π) Entity["Planet", "Earth"]["Radius"] ^ 2Compare with GeoArea, which uses an ellipsoidal model of the Earth:
GeoArea[Polygon[{b1, b2, b3}]]Take three points on a hypersphere:
SeedRandom[123];
{q, p, r} = RandomReal[Pi, {3, 5}]The result of SphericalAngle can also be computed using VectorAngle:
{cq, cp, cr} = FromPolarCoordinates[Prepend[#, 1]]& /@ {q, p, r};VectorAngle[cq - cq.cp cp, cr - cr.cp cp] === SphericalAngle[p -> {q, r}]History
Text
Wolfram Research (2024), SphericalAngle, Wolfram Language function, https://reference.wolfram.com/language/ref/SphericalAngle.html.
CMS
Wolfram Language. 2024. "SphericalAngle." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SphericalAngle.html.
APA
Wolfram Language. (2024). SphericalAngle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SphericalAngle.html
BibTeX
@misc{reference.wolfram_2026_sphericalangle, author="Wolfram Research", title="{SphericalAngle}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/SphericalAngle.html}", note=[Accessed: 16-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_sphericalangle, organization={Wolfram Research}, title={SphericalAngle}, year={2024}, url={https://reference.wolfram.com/language/ref/SphericalAngle.html}, note=[Accessed: 16-June-2026]}