🌍 Spherical Trigonometry
Interactive spherical trigonometry simulator. Place three points on a rotating globe, draw great-circle arcs between them, and see real-time arc lengths, interior angles and spherical excess computed from the spherical law of cosines.
🌍 What It Demonstrates
On the surface of a sphere, the shortest path between two points is an arc of a great circle — a circle whose plane passes through the sphere's centre. Three points connected by three great-circle arcs form a spherical triangle. Unlike a flat (planar) triangle, whose interior angles always sum to exactly 180°, a spherical triangle's angles sum to more than 180°. The amount by which they exceed 180° is the spherical excess E = A + B + C − 180°, and by Girard's theorem the triangle's area on a sphere of radius R equals E·R² (with E measured in radians). This simulation computes arc lengths using the spherical law of cosines, cos(c) = cos(a)cos(b) + sin(a)sin(b)cos(C), and derives the interior angles and excess from the three arc lengths.
How to Use
- Drag the globe with the mouse to rotate it and view the triangle from any angle.
- Adjust the latitude/longitude sliders for points A (red), B (green) and C (blue) to reshape the spherical triangle.
- Toggle the lat/long grid, the great-circle arcs and the straight chords to compare the curved surface path against the straight 3D line through the sphere's interior.
- Watch the Arc Lengths, Interior Angles and spherical excess panels update live as you move the points.
Did You Know?
Commercial airliners flying between distant cities follow great-circle routes rather than the straight line drawn on a flat Mercator map, because the great circle is the true shortest path on the globe — a flight from New York to Tokyo actually arcs up near the Arctic. Spherical trigonometry, developed by astronomers and navigators centuries before satellites, is still the basis of celestial navigation, GPS position calculations and the design of geodesic structures. A spherical triangle covering an octant of the Earth (one eighth of the sphere) has three 90° angles, an angle sum of 270°, and a spherical excess of exactly 90° — a shape with no planar equivalent.
About this simulation
This simulator renders a spherical triangle on a hand-projected 3D globe and computes its geometry with real spherical trigonometry. Three draggable-by-slider points on the sphere's surface are joined by great-circle arcs, and the simulator derives each arc's central angle, each interior angle and the spherical excess — the amount by which the angle sum exceeds 180°, which by Girard's theorem is directly proportional to the triangle's area.
🔬 What it shows
Each point is stored as a latitude/longitude pair, converted to a 3D unit vector, then rotated and orthographically projected to the canvas. Great-circle arcs are drawn by spherically interpolating (slerp) between two unit vectors; the spherical law of cosines converts the three arc lengths into the triangle's interior angles.
🎮 How to use
Drag the canvas to spin the globe. Move the six latitude/longitude sliders to reposition points A, B and C. Toggle the grid, the curved great-circle arcs and the straight 3D chords to see how a "straight line" through the sphere differs from the shortest path along its surface.
💡 Did you know?
An octant triangle — one eighth of a sphere — has three right angles, an angle sum of 270° and a spherical excess of exactly 90°, a shape with no flat-geometry equivalent at all.
Frequently asked questions
Why do spherical triangle angles sum to more than 180°?
A flat triangle's angles sum to 180° because the plane has zero curvature. A sphere has positive curvature, which bends the great-circle "straight lines" so that the triangle bulges outward. The greater the triangle's area relative to the sphere, the larger the angle sum becomes above 180°.
What is the spherical law of cosines used for here?
Given two arc lengths and the angle between them, cos(c) = cos(a)cos(b) + sin(a)sin(b)cos(C) computes the third arc length. Applying it three times (once per vertex) lets the simulator work backward from the three arc lengths to recover each interior angle.
What is Girard's theorem?
Girard's theorem states that a spherical triangle's area equals its spherical excess E (in radians) multiplied by the square of the sphere's radius: Area = E·R². It is the spherical analogue of the fact that a flat triangle's area depends on its base and height rather than its angles.
Why show both great-circle arcs and straight chords?
The great-circle arc is the shortest path along the sphere's surface between two points. The straight chord is a 3D line segment that cuts through the sphere's interior. Comparing them shows visually why "as the crow flies" on a globe is a curve, not a straight line, when drawn on a flat map.
Is this how real navigation and flight routes work?
Yes. Ships and aircraft plan long-distance routes along great circles because they are the shortest path on a sphere. Celestial navigation and GPS calculations both rely on the same spherical trigonometry formulas implemented in this simulation.
Place three points on a rotatable globe to form a great-circle triangle. Live arc lengths, interior angles and spherical excess are computed via the spherical law of cosines and Girard's theorem, showing why spherical triangle angles always sum to more than 180 degrees.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install