Spheres, equations and terminology

Written by Paul Bourke
April 1992

OpenGL/GLUT source code demonstrating the Great Circle


Definition

The most basic definition of the surface of a sphere is "the set of points an equal distance (called the radius) from a single point called the center". Or as a function of 3 space coordinates (x,y,z), all the points satisfying the following lie on a sphere of radius r centered at the origin

For a sphere centered at a point (xo,yo,zo) the equation is simply

If the expression on the left is less than r2 then the point (x,y,z) is on the interior of the sphere, if greater than r2 it is on the exterior of the sphere.

A sphere may be defined parametrically in terms of (u,v)

Where 0 <= theta < 2 pi, and -pi/2 <= phi <= pi/2. The convention in common usage is for lines of constant theta to run from one pole (phi = -pi/2 for the south pole) to the other pole (phi = pi/2 for the north pole) and are usually refered to as lines of longitude. Lines of constant phi are often refered to as lines of latitude, for example the equator is at phi = 0.

Lines through a sphere

A line can intersect a sphere at one point in which case it is called a tangent. It can not intersect the sphere at all or it can intersect the sphere at two points, the entry and exit points.
For the mathematics for the intersection point(s) of a line (or line segment) and a sphere see this.

Antipodal points

A line that passes through the center of a sphere has two intersection points, these are called antipodal points.

Planes through a sphere

A plane can intersect a sphere at one point in which case it is called a tangent plane. Otherwise if a plane intersects a sphere the "cut" is a circle. Lines of latitude are examples of planes that intersect the Earth sphere.


Lines of latitude

Lines of longitude (Meridians)

Great Circles

A great circle is the intersection a plane and a sphere where the plane also passes through the center of the sphere. Lines of longitude and the equator of the Earth are examples of great circles. Two points on a sphere that are not antipodal define a unique great circle, it traces the shortest path between the two points. If the points are antipodal there are an infinite number of great circles that pass through them, for example, the antipodal points of the north and south pole of Earth (there are of course infinitely many others).

Great circles define geodesics for a sphere. (A geodesic is the closest path between two points on any surface).

Lune

A lune is the area between two great circles who share antipodal points. If the angle between the planes defining the great circle is A, then the area of a lune on a sphere of radius r is

area = 2 A r2
Triangles

A triangle on a sphere is defined as the intersecting area of three great circles. Unlike a plane where the interior angles of a triangle sum to pi radians (180 degrees), on a sphere the interior angles sum to more than pi. As the sphere becomes large compared to the triangle then the the sum of the internal angles approach pi.

The area of a spherical triangle with internal angles A,B,C is simply

area = r2 ( A + B + C - pi )

In terms of the lengths of the sides of the spherical triangle a,b,c then

area = 4 arctan [ sqrt( tan(m/2) tan((m-a)/2) tan((m-b)/2) tan((m-c)/2) ) ]
where m = ( a+b+c ) / 2

A similar result for a four sided polygon on the surface of a sphere is

area = r2 ( A + B + C + D - 2 pi )

Ellipsoid

An ellipsoid squashed along each (x,y,z) axis by a,b,c is defined as

Or parametrically