CTAN Comprehensive TeX Archive Network

Directory macros/luatex/latex/luahyperbolic

README.md

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 package and a Lua library for performing operations and drawing pictures in hyperbolic geometry, intended for use with Lua. The package provides complex number manipulation and hyperbolic geometric functions.triangle_tiling_5_4

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:minimal example

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.

  1. Find your TEXMFHOME directory:
   kpsewhich -var-value=TEXMFHOME
   
  1. Copy the file to:
   <TEXMFHOME>/tex/latex/luahyperbolic/
   

If the directory does not exist, create it.

  1. No further action is usually required; will automatically find the package.

System-wide installation (advanced)

To install the package for all users, place it in the local 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 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 . The package is written in Lua and requires Lua.

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 macro

Example tiling : https://raw.githubusercontent.com/dmegy/luahyperbolic/refs/heads/main/triangle-tiling-2-4-5.png

PackageLua Hyperbolic
Repository
Version 2026-11-13
LicensesCC0 1.0
MaintainerDamien Mégy
Contained inTeX Live as luahyperbolic
MiKTeX as luahyperbolic
TopicsLua
Maths
...
Guest Book Sitemap Contact Contact Author