Mathematics • History • Visualization

Non-Euclidean Geometry — Hyperbolic and Elliptic Worlds

For two millennia Euclid’s fifth postulate resisted proof. When mathematicians finally let it fail, space itself bent: triangles grew fat on spheres and thin in hyperbolic planes, parallels multiplied, and the universe learned to curve.

Poincaré disk — geodesics are circles orthogonal to the boundary
Angles are preserved, distances blow up near the edge.

Euclidean geometry feels inevitable because our tabletop experience is almost flat. But “straight line” really means geodesic — the shortest path on a surface — and “parallel” depends on curvature. On a sphere, all geodesics meet. In a saddle-shaped plane, infinitely many parallels slip past a point. This page tells that story with history, formulas, and working pictures you can manipulate offline.

Three constant-curvature planes:
K = 0 (Euclidean)
Angle sum = π, area independent of angles, unique parallel.
K = +1/R² (Spherical/Elliptic)
Angle sum > π, area = R²·(sum−π), no parallels.
K = −1/k² (Hyperbolic)
Angle sum < π, area = k²·(π−sum), infinitely many parallels.

1. Euclid’s Fifth Postulate — Two Thousand Years of Unease

Euclid (c. 300 BCE) began the Elements with five postulates. The first four are blunt and short: draw a straight line between points, extend it, draw circles, all right angles equal. The fifth sprawls:

“If a straight line falling on two straight lines makes interior angles on the same side less than two right angles, the two lines, if produced indefinitely, meet on that side.”

This is the parallel postulate. Euclid himself used it late (Proposition 29), as if uneasy. Playfair’s equivalent (1795) is cleaner: Through a point not on a given line there is exactly one line parallel to the given line.

Attempts to prove it

Proclus (5th c.) criticized its complexity. Islamic mathematicians made decisive progress. Ibn al-Haytham (Alhazen, c. 1000) studied quadrilaterals with two right angles. Omar Khayyam (c. 1100) used a quadrilateral with equal sides perpendicular to the base; he derived the three hypotheses — right, obtuse, acute summit angles — corresponding to Euclidean, spherical, and hyperbolic cases, but rejected the latter two as contradictory. Nasir al-Din al-Tusi (1250) gave a flawed “proof” but clearly stated the alternatives.

In Europe, Saccheri (1733) in Euclides ab omni naevo vindicatus systematically explored the Khayyam–Saccheri quadrilateral. Assuming the acute angle hypothesis, he proved theorem after theorem — angle sums below 180°, lines asymptotic, strange distance growth — then claimed a contradiction from “repugnance to the nature of the straight line.” Lambert (1766) went further, noting the acute hypothesis implied a geometry on a sphere of imaginary radius, and derived formulas strikingly similar to spherical trigonometry with hyperbolic functions.

The breakthrough

Gauss privately (by 1817) believed a consistent non-Euclidean geometry existed but published nothing, fearing “the outcry of the Boeotians.” János Bolyai (1832), a Hungarian officer, wrote to his father: “Out of nothing I have created a strange new universe.” Independently, Nikolai Lobachevsky published “On the principles of geometry” in Kazan (1829–30), developing trigonometry, parallelism angle Π(d), and horocycles.

The key conceptual shift: consistency does not require Euclidean intuition. Beltrami (1868) built a concrete model inside a Euclidean disk where “lines” are chords (Klein model) and verified the hyperbolic axioms, proving relative consistency: if Euclidean geometry is consistent, so is hyperbolic. Poincaré (1882) gave the conformal disk model that preserves angles, making pictures intuitive. Klein named the three geometries elliptic, parabolic, Euclidean, hyperbolic, unifying them via projective metrics.

Philosophically, this ended Kant’s claim that Euclidean space is a priori. Mathematically, it opened differential geometry, topology, and general relativity.

2. Spherical (Elliptic) Geometry — Great Circles and Excess

Take a sphere of radius R. Define a “line” as a great circle — intersection of the sphere with a plane through its centre. Any two distinct great circles meet at two antipodal points. There are no parallels.

Distance and geodesics

Points are represented by unit vectors p ∈ S². The central angle between p and q is γ = arccos(p·q). Distance along the sphere is d = Rγ. Great circles are geodesics because they locally minimize length (Theorema Egregium will later explain why).

Use spherical coordinates (latitude φ, longitude λ). The haversine formula avoids numerical issues:

d = 2R arcsin(√[sin²((φ2−φ1)/2) + cos φ1 cos φ2 sin²((λ2−λ1)/2)])

Triangles

A spherical triangle has three great-circle sides a,b,c (measured as central angles) and interior angles A,B,C at vertices. The spherical law of cosines:

cos a = cos b cos c + sin b sin c cos A

and its dual for angles: cos A = −cos B cos C + sin B sin C cos a.

Crucially, A + B + C > π. Define excess E = A + B + C − π.

Girard’s Theorem (1625)

Area of a spherical triangle on radius R is:

Area = R²·E

Proof sketch via lunes: extend each side to a full great circle. A lune with angle A covers fraction A/(2π) of the sphere, area 2R²A. Summing three lunes counts the triangle three times plus its antipode. Subtract the overcount to get 2R²(A+B+C) = 4πR² + 4·Area, yielding the formula.

Example: an octant triangle bounded by equator and two meridians 90° apart has A=B=C=π/2, sum=3π/2, E=π/2, area = R²π/2, exactly one-eighth of 4πR².

Elliptic plane

If we identify antipodal points (glue opposite points), each pair of “lines” meets exactly once, satisfying projective axioms. This elliptic plane has constant curvature +1/R², finite total area 2πR², and is non-orientable like the projective plane.

Practical consequences: on Earth, “straight” flight paths are great circles, causing routes over poles to look curved on Mercator maps. No map can preserve both area and angles — a direct corollary of curvature.

3. Hyperbolic Geometry — Lobachevsky, Bolyai, Gauss

Negate Playfair: through P not on ℓ there are at least two distinct parallels to ℓ. In fact, there are infinitely many.

Basic phenomena

  • Angle sum of a triangle is strictly less than π. Defect D = π − (A+B+C) > 0.
  • Area = k²·D for plane of curvature K = −1/k² (Lobachevsky). Hence similar triangles are congruent — scaling changes angles.
  • Rectangles (four right angles) do not exist. A quadrilateral with three right angles forces the fourth to be acute.
  • Distance grows exponentially: circumference of circle radius r is 2πk sinh(r/k), area is 2πk²(cosh(r/k)−1).
  • Two kinds of parallels: asymptotic (meet at infinity) and ultraparallel (have a unique common perpendicular and diverge).

The parallelism angle Π(d) relates a point’s distance d from a line to the limiting parallel: tan(Π(d)/2) = e^(−d/k). As d→0, Π→π/2 (Euclidean); as d grows, Π shrinks.

Models

We cannot isometrically embed the full hyperbolic plane in Euclidean 3-space (Hilbert 1901), but we can model it.

Poincaré disk (|z|<1): Metric ds = 2k|dz|/(1−|z|²). Geodesics are diameters and arcs orthogonal to |z|=1. Conformal — Euclidean angles equal hyperbolic angles. Ideal boundary |z|=1 is at infinity.

Upper half-plane (Im w>0): ds = k|dw|/Im w. Geodesics are vertical half-lines and semicircles orthogonal to real axis. Isometries are real Möbius transformations w → (aw+b)/(cw+d), ad−bc>0, i.e., PSL(2,R).

Klein–Beltrami disk: Points inside Euclidean disk, “lines” are Euclidean chords. Not conformal but projective, straight-looking. Metric via cross-ratio.

Hyperboloid (Minkowski): Set { (x,y,t) | x²+y²−t² = −k², t>0 } with Lorentz metric ds² = dx²+dy²−dt². Intrinsic curvature −1/k², geodesics are intersections with planes through origin. Isometries are Lorentz transformations SO(2,1).

All four are isometric; Poincaré is best for drawing because it preserves shapes locally.

Trigonometry

Hyperbolic law of cosines: cosh(c/k) = cosh(a/k) cosh(b/k) − sinh(a/k) sinh(b/k) cos C. For small triangles, using cosh≈1+x²/2 recovers Euclidean c² = a²+b²−2ab cos C.

Law of sines: sin A / sinh(a/k) = sin B / sinh(b/k) = sin C / sinh(c/k).

4. Models, Isometries, and Distance Formulas

Unification comes via Möbius transformations preserving a circle.

In the Poincaré disk, isometries are:

T(z) = e^{iθ} (z−a)/(1−\bar a z), |a|<1

These form PSU(1,1) ≅ PSL(2,R). They map geodesics to geodesics and preserve the metric.

Distance

The Poincaré distance satisfies:

cosh(d/k) = 1 + 2|z−w|² / [(1−|z|²)(1−|w|²)]

Equivalently, d = 2k artanh(|(z−w)/(1−\bar w z)|). Derivation: map w→0 via isometry, then radial distance from 0 is integral ∫_0^r 2k dr/(1−r²) = 2k artanh r.

In upper half-plane: cosh(d/k) = 1 + |w1−w2|²/(2 Im w1 Im w2).

In Klein model, distance uses cross-ratio (P,Q; A,B) where A,B are ideal endpoints of chord PQ: d = (k/2) |ln(P,Q;A,B)|.

Horocycles and ideal points

Circles tangent to the boundary are horocycles — curves of constant distance from an ideal point, with zero geodesic curvature. In the disk they look like Euclidean circles touching |z|=1 internally. Horocyclic distance grows linearly, not exponentially, making them useful for fixing a “center at infinity.”

ModelLinesConformal?Isometry group
Poincaré diskOrthogonal arcsYesPSU(1,1)
Half-planeSemicircles ⊥ ℝYesPSL(2,R)
KleinChordsNoPGL(2,R)
HyperboloidPlane sectionsNoSO(2,1)

5. Curvature and the Gauss–Bonnet Theorem

Gaussian curvature K at a point measures how area of an infinitesimal geodesic circle deviates from Euclidean πr²: Area = πr² − (πK/12) r⁴ + …

Sphere radius R: K = +1/R² everywhere. Pseudosphere (tractrix revolved): K = −1. Euclidean plane: K = 0.

Gauss’s Theorema Egregium (1827): K is intrinsic — determinable by measuring inside the surface, without embedding. Hence a flat sheet cannot be bent into a sphere without stretching.

Gauss–Bonnet

For a compact oriented surface M with piecewise-smooth boundary:

∬_M K dA + ∮_∂M κ_g ds + Σ (π − interior angle) = 2π χ(M)

where κ_g is geodesic curvature, χ is Euler characteristic (χ=2−2g for genus g surface).

Apply to a geodesic triangle (κ_g=0, three exterior jumps):

∬_Δ K dA = A+B+C − π

Thus for constant K:

K·Area = angle sum − π

This single formula yields Girard (K>0) and the hyperbolic defect formula (K<0). Euclid is the degenerate K=0 case.

Implications: topology constrains geometry. A sphere (χ=2) cannot have K≤0 everywhere; total curvature must be 4π. A torus (χ=0) admits flat metric (K=0) and also hyperbolic metrics when punctured.

Uniformization theorem (Poincaré–Koebe): every simply connected Riemann surface is conformally equivalent to sphere, plane, or disk — i.e., constant curvature +1,0,−1.

6. Applications — From Relativity to Art to Networks

General relativity

Einstein (1915) replaced gravitational force with spacetime curvature. Spatial slices of the universe in Friedmann–Lemaître–Robertson–Walker cosmology have constant curvature k = +1,0,−1. Observations of CMB suggest |Ω_k| < 0.001, nearly flat, but hyperbolic (k=−1) remains permitted. Near massive bodies, space is non-Euclidean: light bending around the Sun (1919 eclipse) measured ~1.75 arcseconds, matching Schwarzschild geometry.

Special relativity as hyperbolic geometry

Velocities add not linearly but via rapidity φ where tanh φ = v/c. Rapidity adds: φ_total = φ1+φ2. The set of attainable velocities is the hyperbolic plane of curvature −1/c² (the velocity hyperboloid). Thomas precession is holonomy around a hyperbolic triangle.

Art and craft

M.C. Escher’s Circle Limit I–IV (1958–60) uses the Poincaré disk to tile the hyperbolic plane with fish, angels, devils. Each tile is congruent hyperbolically, appearing smaller toward the edge. The condition for regular {p,q} tessellation (p-gons meeting q at each vertex) is (p−2)(q−2) > 4 for hyperbolic, =4 Euclidean, <4 spherical. Hence {7,3} fits hyperbolically but impossible on a flat floor.

Daina Taimina (1997) crocheted hyperbolic planes, making physical models of constant negative curvature impossible to smoothly embed but easy to craft via increasing stitches exponentially.

Networks and data

Scale-free networks (internet, social graphs) embed naturally in hyperbolic space because exponential volume growth matches exponential degree distribution. Papadopoulos et al. (2010) showed greedy routing using hyperbolic coordinates succeeds with near 100% delivery without global knowledge. Embedding trees isometrically requires hyperbolic space — any tree embeds with arbitrarily low distortion into H², but not into Euclidean plane.

Navigation and cartography

Great-circle navigation shortens flights by up to 20% versus rhumb lines. The impossibility of a perfect flat map follows from curvature: any distance-preserving map from sphere to plane would imply K=0, contradiction.

Biology and materials

Hyperbolic geometry appears in ruffled leaves, coral, and brain folding where surface grows faster than interior, inducing negative curvature to relieve stress. Architecturally, saddle roofs (hyperbolic paraboloids) are doubly ruled and structurally efficient.

7. Interactive Explorations

All three canvases run locally with vanilla JavaScript. No external libraries.

Poincaré Disk — draw hyperbolic lines and triangles

Click two points inside the circle to draw a geodesic. In triangle mode click three points; sum of angles will be <180°.

Spherical Triangle — drag vertices on a sphere

Drag the colored handles. Great-circle arcs are drawn. On a unit sphere, area = excess.

Hyperbolic Parallels — many lines through P miss ℓ

Base line ℓ is the horizontal diameter. Drag the blue point P. The two bold arcs are limiting parallels asymptotic to ℓ at the boundary. The faint family between them are ultraparallels — they never meet ℓ inside the disk, demonstrating infinitely many parallels in hyperbolic geometry.

8. Octave / MATLAB Examples — Five Scripts

Copy into Octave. All run without toolboxes.

1) Hyperbolic distance in Poincaré disk

function d = hyperbolic_distance(z,w,k)
  if nargin<3, k=1; end
  % z,w complex with |z|,<1
  num = 2*abs(z-w)^2;
  den = (1-abs(z)^2)*(1-abs(w)^2);
  d = k * acosh(1 + num/den);
endfunction

% Example
z = 0.3 + 0.2i; w = -0.4 + 0.1i;
printf("d = %.4f\n", hyperbolic_distance(z,w));

2) Plot a Poincaré geodesic between two points

function plot_geodesic(z1,z2)
  t = linspace(0,1,200);
  if abs(z1*conj(z2)-conj(z1)*z2) < 1e-8
    % diameter
    pts = (1-t)*z1 + t*z2;
  else
    % find orthogonal circle center
    p1=[real(z1),imag(z1)]; p2=[real(z2),imag(z2)];
    A = [2*p1(1), 2*p1(2); 2*(p2(1)-p1(1)), 2*(p2(2)-p1(2))];
    b = [p1(1)^2+p1(2)^2+1; p2(1)^2+p2(2)^2 - p1(1)^2 - p1(2)^2];
    c = A\b; cx=c(1); cy=c(2);
    r = hypot(cx-p1(1), cy-p1(2));
    a1=atan2(p1(2)-cy,p1(1)-cx); a2=atan2(p2(2)-cy,p2(1)-cx);
    % choose short arc inside disk
    if mod(a2-a1+2*pi,2*pi) > pi, tmp=a1;a1=a2;a2=tmp; endif
    ang = linspace(a1,a2,200);
    pts = cx + r*cos(ang) + 1i*(cy + r*sin(ang));
  endif
  theta = linspace(0,2*pi,400); plot(cos(theta),sin(theta),'k'); hold on;
  plot(real(pts),imag(pts),'b','linewidth',2); axis equal off;
endfunction

plot_geodesic(0.2+0.5i, -0.3+0.1i);

3) Spherical triangle area via Girard

function [E,area] = spherical_excess(p1,p2,p3,R)
  if nargin<4, R=1; end
  % p_i are 3x1 unit vectors
  a = acos(dot(p2,p3)); b = acos(dot(p1,p3)); c = acos(dot(p1,p2));
  A = acos( (cos(a)-cos(b)*cos(c))/(sin(b)*sin(c)) );
  B = acos( (cos(b)-cos(a)*cos(c))/(sin(a)*sin(c)) );
  C = acos( (cos(c)-cos(a)*cos(b))/(sin(a)*sin(b)) );
  E = A+B+C - pi;
  area = R^2 * E;
endfunction

% Example: octant
p1=[1;0;0]; p2=[0;1;0]; p3=[0;0;1];
[E,A]=spherical_excess(p1,p2,p3,6371);
printf("Excess=%.4f rad, Area=%.0f km^2\n",E,A);

4) Hyperbolic {7,3} tessellation (first two rings)

function draw_73()
  clf; hold on; axis equal off;
  theta=linspace(0,2*pi,500); plot(cos(theta),sin(theta),'k');
  % central regular heptagon in Poincaré disk
  p=7; q=3; 
  % inradius for {p,q}
  a = 2*pi/p; 
  % distance from center to vertex
  d = acosh( cos(pi/q)/sin(pi/p) ); 
  r = tanh(d/2); % Euclidean radius in disk
  verts = r*exp(1i*(0:p-1)*2*pi/p);
  for k=1:p
    plot_geodesic(verts(k), verts(mod(k,p)+1));
  endfor
  title("{7,3} first ring");
endfunction
draw_73();

5) Verify Gauss–Bonnet for hyperbolic triangle

function gauss_bonnet_demo()
  z = [0.1+0.2i, -0.3+0.4i, 0.25-0.35i];
  % compute hyperbolic angles (conformal = Euclidean between tangents)
  angs=zeros(1,3);
  for i=1:3
    p=z(i); q1=z(mod(i,3)+1); q2=z(mod(i+1,3)+1);
    v1 = tangent_dir(p,q1); v2 = tangent_dir(p,q2);
    angs(i)=acos( dot([real(v1),imag(v1)],[real(v2),imag(v2)]) );
  endfor
  defect = pi - sum(angs);
  % numerical area integral in disk: area = 4 ∫∫ dxdy/(1-r^2)^2
  [X,Y]=meshgrid(linspace(-.99,.99,600));
  Z=X+1i*Y; in = abs(Z)<1 & inpolygon(real(Z),imag(Z),real(z),imag(z));
  area = sum(sum(4./(1-abs(Z(in)).^2).^2)) * (1.98/599)^2;
  printf("Sum angles=%.2f deg, defect=%.4f, numeric area=%.4f\n", sum(angs)*180/pi, defect, area);
endfunction

function v = tangent_dir(p,q)
  if abs(imag(conj(p)*q))<1e-8 % diameter
    v = (q-p)/abs(q-p); return;
  endif
  p1=[real(p),imag(p)]; p2=[real(q),imag(q)];
  A=[2*p1(1),2*p1(2);2*(p2(1)-p1(1)),2*(p2(2)-p1(2))];
  b=[sum(p1.^2)+1; sum(p2.^2)-sum(p1.^2)];
  c=A\b; t=[-(p1(2)-c(2)), p1(1)-c(1)]; if dot(t,p2-p1)<0, t=-t; end
  v = (t(1)+1i*t(2))/norm(t);
endfunction

All five scripts illustrate the core formulas: distance blows up at the boundary, geodesics are orthogonal circles, spherical excess equals area, regular tilings exist only when curvature permits, and Gauss–Bonnet unifies the three geometries.