Reference

Contents

Index

PoincareDisk._circle_through — Method
_circle_through(z1, z2, z3) -> (center::Complex, radius::Float64)

Find the Euclidean circumcenter/radius of three complex points. This is used for reflections which operate in unscaled disk coordinates rather than drawing coordinates.

source
PoincareDisk._geodesic_points — Method
_geodesic_points(a, b; 
    radius=DEFAULT_DISK_RADIUS, 
    diskcenter=O, 
    steps=60)

Return Points along the hyperbolic geodesic line joining disk points a and b.

If a, b and the origin are collinear, return the two endpoints.

source
PoincareDisk.complex_to_point — Method
complex_to_point(z; radius=DEFAULT_DISK_RADIUS, diskcenter=O)

Convert a point z on the unit disk (a complex number with |z| < 1) into a Point on the Luxor drawing, scaling by radius and shifting so the disk is centered at diskcenter.

Uses the global constant DEFAULT_DISK_RADIUS.

source
PoincareDisk.draw_tiling — Method
draw_tiling(tiles; 
    radius=DEFAULT_DISK_RADIUS, 
    diskcenter=O, 
    action=:stroke, 
    steps=16, 
    colors=nothing)

Draw the hyperbolic tiling by drawing every hyperpolygon in the array of tiles produced by hyperbolic_tiling().

Apply action when drawing each tile. The default is :fill.

colors can be supplied as an array of two colorants. This will use generation number of each tile to flip between the two colours. If q is even, the tiling has a "chess board" appearance. Otherwise a random colour is used.

Use radius to specify the radius of the Poincaré disk when drawing points.

source
PoincareDisk.hyperbolic_circle — Method
hyperbolic_circle(center, rho; 
    radius=DEFAULT_DISK_RADIUS, 
    diskcenter=O, 
    action=:stroke)

Construct the hyperbolic circle of hyperbolic radius rho centered at disk point center. The action is applied.

Return the Luxor coordinates of the center and radius.

source
PoincareDisk.hyperbolic_line — Method
hyperbolic_line(z1, z2; 
    radius=DEFAULT_DISK_RADIUS, 
    diskcenter=O, 
    action=:stroke, 
    steps=60)

Make the hyperbolic geodesic line between disk points z1 and z2, and apply the Luxor poly function with action.

Return an array of the coordinates of the points.

source
PoincareDisk.hyperbolic_poly — Method
hyperbolic_poly(vertices; 
    radius=DEFAULT_DISK_RADIUS, 
    diskcenter=O, 
    action=:stroke, 
    steps=40)

Construct the closed hyperbolic polygon with vertices, joined by geodesic edges. Use steps to define the smoothness of the curve.

Apply the Luxor poly function to the results, using action.

Return the points.

The unique circle orthogonal to the unit circle that passes through a and b also passes through a* = 1/conj(a), the inversion of a in the unit circle. The geodesic circle is the circle through 3 points ((a, b, a*).

For hyperbolic circles, the hyperbolic center moves to the origin via a Möbius mapping, so a hyperbolic circle of radius rho is the Euclidean circle of radius tanh(rho/2).

source
PoincareDisk.hyperbolic_tiling — Method
hyperbolic_tiling(p, q; 
    depth = 8, 
    hcenter = 0.0 + 0.0im, 
    rotation = 0.0, 
    maxtiles = 4000)

Construct the coordinates for a hyperbolic tiling of the Poincaré disk, with polygons with p sides and q lines joining at each vertex.

Returns an array where each element contains:

  • an array of complex numbers (the disk coordinates of each polygon)

  • the tile's generation number: depth specifies how many generations

maxtiles tiles limits the number of tiles.

p and q must satisfy 1/p + 1/q < 1/2 (the hyperbolic condition). Most of the simpler tilings are listed in this table:

p:q123456789101112
1
2
3✓✓✓✓✓✓
4✓✓✓✓✓✓✓✓
5✓✓✓✓✓✓✓✓✓
6✓✓✓✓✓✓✓✓✓
7✓✓✓✓✓✓✓✓✓✓
8✓✓✓✓✓✓✓✓✓✓
9✓✓✓✓✓✓✓✓✓✓
10✓✓✓✓✓✓✓✓✓✓
11✓✓✓✓✓✓✓✓✓✓
12✓✓✓✓✓✓✓✓✓✓

For example, (5, 4), (7, 3), and (4, 5) are all accepted. The 'simplest' tiling of a triangle is (3, 7), such that 7 lines connect at each of the triangles' vertices.

Starting with the basic polygon, a hyperbolic polygon centered at hcenter, the tiling is built by reflecting each tile across each of its edges. A hyperbolic reflection is an inversion in the edge's circle.

source