Reference
Contents
Index
PoincareDisk._circle_throughPoincareDisk._geodesic_arc_infoPoincareDisk.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.mobius_to_originPoincareDisk.point_to_complexPoincareDisk.regular_hyperbolic_poly
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_arc_info — Method
_geodesic_arc_info(a, b; radius=DEFAULT_DISK_RADIUS, diskcenter=O)Build the hyperbolic geodesic that passes through disk points a and b. It can either be a circular arc or a straight line - which happens when a and b form a diameter.
Returns one of three different results:
(:arc, center, r, theta1, theta2)— the geodesic is
an arc centered at center with radius r. The arc runs counterclockwise from angle theta1 to theta2 and does not pass through the excluded point (the inversion of a in the unit circle).
(:carc, center, r, theta1, theta2)— the geodesic is
an arc centered at center with radius r, but the non-excluded arc runs clockwise from theta1 to theta2.
(:line, p1, p2)—a,b, and the origin are collinear, so the geodesic is just a straight line between the pointsp1andp2.
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 arc is the arc of the circle through (a, b, a*) that avoids a*.
PoincareDisk.complex_to_point — Method
complex_to_point(z; radius=DEFAULT_DISK_RADIUS, diskcenter::Point=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)Construct the boundary circle of the Poincaré disk itself. The default Luxor action used here is :stroke, or you could use, eg, :fill.
PoincareDisk.draw_tiling — Method
draw_tiling(tiles;
radius=DEFAULT_DISK_RADIUS,
diskcenter=O,
action=:fill,
colors=nothing)Draw the hyperbolic tiling produced by hyperbolic_tiling() by drawing every hyperpolygon in the array of tiles, using the provided colors.
Apply Luxor action to the path that describes each tile. The default is :fill.
colors can be supplied as an array of two colorants. The generation number of each tile is used to alternate between the two colours. If q is even, the tiling has a "chess board" appearance.
Otherwise random colors are 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 and b.
Returns (:diameter, theta, 0.0) for a diameter at angle theta, or (:circle, center, r) for a 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 (default :stroke) is applied.
Return the Luxor coordinates of the circle's center and radius.
PoincareDisk.hyperbolic_distance — Method
hyperbolic_distance(a, b)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)Construct a new path that makes the hyperbolic geodesic between disk points z1 and z2 as a circular arc (or a straight line, if collinear).
Then the action is applied. The default action is :stroke.
Returns either the (center, radius) of a circle that would contain the arc, or (nothing, nothing) if it's a diameter.
PoincareDisk.hyperbolic_point — Method
hyperbolic_point(z;
radius=DEFAULT_DISK_RADIUS,
dotradius = 5,
diskcenter=O)Draw a small filled circle of radius dotradius to mark the location of the hyperbolic point at complex number z. Return the coordinates of the Luxor point.
PoincareDisk.hyperbolic_poly — Method
hyperbolic_poly(vertices;
radius=DEFAULT_DISK_RADIUS,
diskcenter=O,
action=:stroke)Construct the closed hyperbolic polygon with vertices, joined by geodesic edges. Each side is built with a circular arc or straight line, giving a chain of arc/carc/line path elements.
Finally apply the Luxor action action to the resulting path. The default is :stroke.
Return nothing.
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 generated.
p and q must satisfy 1/p + 1/q < 1/2. 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(w, a)Find the inverse of the mobius_to_origin() function: ie send 0 to a.
PoincareDisk.mobius_to_origin — Method
mobius_to_origin(z, a)Apply a Möbius transformation that maps the unit disk to itself. This "recenters" the disk so that the point a moves to the origin 0 while everything stays inside the unit disk. Angles are preserved.
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.