Hyperbolic triangles, motions and tilings
The angles of a hyperbolic triangle add up to less than two right angles, and what is missing is its area. So no triangle, however long its sides, has area more than π. Regular polygons can have any small enough angle, which is why seven-sided tiles can meet three at a corner.
const t = htriangle([0, 0], ["1/2", 0], [0, "1/2"]);
t.angles.A.text; // "π/2"
t.defect; // π − (A + B + C): the area
t.checks().all; // true: the laws of hyperbolic trigonometry, exactly
htriangle(ideal(1, 0), ideal(0, 1), ideal(-1, 0)).area.text; // "π": the largest a triangle can be
hrotation(["1/2", 0], "1/6").classify(); // { kind: "rotation", center, angle: π/3 }
htranslation([0, 0], ["1/2", 0]).classify(); // { kind: "translation", axis, length: ln(3) }
hyperbolicTiling(7, 3).patch(4).counts; // [1, 7, 21, 56, 147]
Triangles and their defect
For a triangle with angles , the defect is . It is always positive, and by Gauss's theorem it is the area. A vertex may be an ideal point: the two sides that run to it are infinitely long and asymptotic, and the angle there is 0. A triangle with all three vertices ideal has defect, and area, exactly π, and every such triangle is congruent to every other.
The angle at a vertex has an exact cosine, computed from the tangent vectors there; the sides have exact . As on the sphere, whether an angle or the defect is a rational multiple of π is decided, and otherwise it is enclosed.
Hyperbolic trigonometry
Replace the sphere's and of a side by and :
For a right angle at the first is Pythagoras' theorem here: . The second says the three angles determine the sides, so there are no similar triangles: a shape has one size. checks() tests all three laws on the triangle given, each as an exact equality.
Isometries
An isometry is a 3 × 3 matrix that keeps the form and the upper sheet of the hyperboloid. line.reflection, hrotation(centre, turns), hhalfTurn(centre) and htranslation(a, b) build them, then composes them, and they act on points, ideal points, lines, triangles and circles. classify() reads any isometry back. The ones that keep orientation come in three kinds, told apart by the trace:
- a rotation about a point (trace less than 3), with its centre and angle;
- a parabolic map (trace exactly 3), which fixes one ideal point and no point of the plane: what a rotation becomes when its centre goes to infinity;
- a translation along a line (trace more than 3), with its axis and length. Only the axis is moved along itself; points off it travel along curves at a fixed distance from it, which are not lines.
Those that reverse orientation are reflections and glide reflections. Every isometry is a product of at most three reflections, and the kind of a product of two is the relation of the two mirrors: intersecting mirrors give a rotation, asymptotic ones a parabolic map, ultraparallel ones a translation along the common perpendicular, by twice the distance between them.
toMobius() gives the same map of the Poincaré disc as a Möbius map with exact complex coefficients, each a pair [re, im]. The translation taking 0 to ½ is . The coefficients can be handed to the complex package's Möbius maps.
Regular tilings
The symbol means regular -gons, around each vertex, so each corner has angle . A Euclidean regular -gon has corner angle , and comparing the two sorts every symbol into one of three geometries:
On the sphere and in the hyperbolic plane the corner angle fixes the size of the tile, and schlafli(p, q) gives it exactly: for the hyperbolic ones,
for the side and the circumradius . Every tile of has area exactly .
hyperbolicTiling(p, q) places one tile at the centre of the disc with exact vertices; check() confirms, exactly, that its corner angle is and its side is the one above (for {7, 3} the numbers have high degree and this takes several seconds). patch(n) grows the tiling outward by reflecting in sides, in floats and labelled kind: "float", and counts the tiles at each step. The counts grow exponentially, as areas do in this plane.
| call | returns |
|---|---|
| htriangle(A, B, C) | HTriangle: sides, angles, angleSum, defect, area, lines, idealVertices, checks() |
| line.reflection, hrotation(c, turns), hhalfTurn(c), htranslation(a, b) | HIsometry: apply, then, inverse, preservesOrientation, classify(), toMobius() |
| schlafli(p, q) | { geometry, interiorAngle, tileArea, edge, circumradius, inradius }, and for the sphere the solid with its faces, vertices and edges |
| hyperbolicTiling(p, q) | The same, with tile (exact vertices), discRadius, check(), patch(layers) |
| hyperbolicTilingFigure(p, q, { layers, model }) | A figure of the tiling in the Poincaré or Klein disc |
@ratmath/geo and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.