Reference
Contents
Index
PoincareDisk._arc_angles_avoidingPoincareDisk._circle_throughPoincareDisk._geodesic_pointsPoincareDisk.complex_to_pointPoincareDisk.draw_poincare_diskPoincareDisk.draw_tilingPoincareDisk.geodesic_supportPoincareDisk.hyperbolic_circlePoincareDisk.hyperbolic_distancePoincareDisk.hyperbolic_linePoincareDisk.hyperbolic_pointPoincareDisk.hyperbolic_polyPoincareDisk.hyperbolic_reflectPoincareDisk.hyperbolic_tilingPoincareDisk.mobius_from_originPoincareDisk.point_to_complexPoincareDisk.regular_hyperbolic_poly
PoincareDisk._arc_angles_avoiding — Method
_arc_angles_avoiding(theta_a, theta_b, theta_x; steps=60)Make an array of steps angles that start at theta_a and go round in a circle theta_b, taking the direction that doesn't pass through theta_x.
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.
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.
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.
PoincareDisk.draw_poincare_disk — Method
draw_poincare_disk(;
radius=DEFAULT_DISK_RADIUS,
diskcenter=O,
action=:stroke)Draw the boundary circle of the Poincaré disk itself. The default Luxor action is :stroke.
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.
PoincareDisk.geodesic_support — Method
geodesic_support(a, b)The circle (or line) supporting a geodesic through disk points a, b.
Returns (:diameter, theta, 0.0) for a diameter at angle theta, or (:circle, center, r) for the orthogonal circle.
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.
PoincareDisk.hyperbolic_distance — Method
hyperbolic_distance(az, bz)Find the hyperbolic distance between two points on the Poincaré disk.
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.
PoincareDisk.hyperbolic_point — Method
hyperbolic_point(z;
radius=DEFAULT_DISK_RADIUS,
dotradius = 5,
diskcenter=O)Draw the hyperbolic point at complex number z using a filled circle of dotradius units. Return the coordinates of the Luxor point.
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).
PoincareDisk.hyperbolic_reflect — Method
hyperbolic_reflect(z, a, b)Reflect disk point z across the hyperbolic geodesic through a and b.
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:
depthspecifies 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:q | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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.
PoincareDisk.mobius_from_origin — Method
mobius_from_origin(wz, az)Find the inverse of the mobius_to_origin() function: ie. send 0 to a.
PoincareDisk.point_to_complex — Method
point_to_complex(p::Point; radius::Real = DEFAULT_DISK_RADIUS, diskcenter::Point = O)Convert the Luxor point p into a coordinate on the Poincaré disk.
Uses the global constant DEFAULT_DISK_RADIUS.
PoincareDisk.regular_hyperbolic_poly — Method
regular_hyperbolic_poly(n, rho;
hcenter=0.0+0.0im,
rotation=0.0)Return the vertices of a regular hyperbolic polygon with n sides that fits inside the hyperbolic circle of radius rho centered at hcenter, with the first vertex placed at angle rotation.