Directory macros/luatex/latex/luahyperbolic
Lua Hyperbolic Geometry
!Note
Luahyperbolic is still in an early development phase.
Changes and bug fixes are happening frequently, check the changelog in the documentation.
luahyperbolic is a LaTeX package and a Lua library for performing operations and drawing pictures in hyperbolic geometry, intended for use with LuaLaTeX. The package provides complex number manipulation and hyperbolic geometric functions.
Example Usage
A minimal working example is (see minimal_example.texin examples/) :
\documentclass[margin=.2cm,multi,tikz]{standalone} \usepackage{luahyperbolic} %loads luacode package \begin{document} \begin{luacode*} hyper.tikzBegin("scale=2.5") local P = complex(0.5,-0.2) local A = complex.exp_i(math.pi/10) for k=1,5 do hyper.drawLine(P, A^k, "teal") end hyper.labelPoint(P, "$P$", "left=.2cm") hyper.drawLine(complex.J,-complex.I,"very thick, dashed, red") hyper.tikzEnd("myfile.tikz") \end{luacode*} \end{document}
Compiling that file with lualatex produces the following output:
It also saves the TikZ picture to myfile.tikz, for later use. (Optional)
See the package documentation (pdf) for numerous examples.
More examples in examples/
License
This package is released under the Public Domain (CC0 1.0 Universal License). You may use, modify, and distribute it freely, without restriction.
For more information on the license, see the LICENSE file or visit CC0 1.0 Universal.
Installation
Quick use (no installation)
The simplest way to use the package is to place the file: luahyperbolic.sty in the same directory as your .tex document.
Then include it with:
\usepackage{luahyperbolic}
User installation (recommended)
To make the package available to all your documents, install it in your personal TEXMF tree.
- Find your TEXMFHOME directory:
kpsewhich -var-value=TEXMFHOME
- Copy the file to:
<TEXMFHOME>/tex/latex/luahyperbolic/
If the directory does not exist, create it.
- No further action is usually required; LaTeX will automatically find the package.
System-wide installation (advanced)
To install the package for all users, place it in the local TeX tree (requires administrative privileges):
/usr/local/texlive/texmf-local/tex/latex/luahyperbolic/
Then refresh the file database:
sudo mktexlsr
Notes
- Do not place files in
texmf-dist, as this directory is managed by your TeX distribution and may be overwritten during updates.
Contact
Do you really need to contact me ? ...
Download the contents of this package in one zip archive (3.7M).
Lua Hyperbolic – Hyperbolic geometry in the Poincaré disk model
This package allows to draw pictures and do computations in plane hyperbolic geometry, in the Poincaré disk model. Computations are done with Lua, and graphics are generated with TikZ. The package is written in Lua and requires LuaLaTeX.
Features:
- Draw geodesic lines, segments, polygons, rays, circles, horocycles, hypercycles.
- Label and mark segments, angles
- Compute intersections of geodesics, circles, symmetries, reflections, exponential maps, automorphisms
- Draw hyperbolic triangle tilings with a simple LaTeX macro
Example tiling : https://raw.githubusercontent.com/dmegy/luahyperbolic/refs/heads/main/triangle-tiling-2-4-5.png
| Package | Lua Hyperbolic |
| Repository | |
| Version | 2026-11-13 |
| Licenses | CC0 1.0 |
| Maintainer | Damien Mégy |
| Contained in | TeX Live as luahyperbolic MiKTeX as luahyperbolic |
| Topics | LuaTeX Maths |