# Update of 'gyro'

I updated the **gyro** package (soon on CRAN). Here are the new
features.

## Hyperbolic polyhedra in the Poincaré model

The previous version of the package only dealt with hyperbolic polyhedra in the Minkowski model. Now it is possible to get hyperbolic polyhedra in the Poincaré model. I don’t provide some example, because they look similar to the polyhedra in the Minkowski model (see this post). I prefer the Minkowski model because one can change the hyperbolic curvature in this model.

## Hyperbolic tilings of the Poincaré disk

The package now provides the `tiling`

function, which draws a hyperbolic
tiling of the Poincaré disk.

```
library(gyro)
tiling(7, 4, depth = 4, border = "darkred", lwd = 2)
```

## Hyperbolic Delaunay tessellations

The package now provides the `hdelaunay`

function, which constructs a
hyperbolic Delaunay triangulation in the Poincaré disk thanks to the C++
library **CGAL**, and the `plotHdelaunay`

function, which plots such a
triangulation.

Unfortunately, this new feature will not be included in the CRAN
version, because of a C++ issue spotted by Valgrind. If you want to use
it, you have to install the **hdelaunay** branch of the Github repo:

`::install_github("stla/gyro@hdelaunay", build_vignettes = TRUE) remotes`

Here is a first example:

```
library(gyro)
library(uniformly)
set.seed(666)
<- runif_in_sphere(50L, d = 2)
points <- hdelaunay(points)
hdel plotHdelaunay(hdel, color="random", luminosity="bright")
```

Actually the faces of the hyperbolic Delaunay triangulation are the same as the ones of the Euclidean Delaunay triangulation, except that they are hyperbolic, up to this point: as you can see on the above plot, there are some edges without incident face; this occurs when the circumcircle of the missing Euclidean Delaunay face is not contained in the unit disk.

Here is a second example, not random:

```
library(gyro)
library(trekcolors)
<- (1 + sqrt(5)) / 2
phi <- head(seq(0, pi/2, length.out = 11L), -1L)
theta <- phi^((2*theta/pi)^0.8 - 1)
a <- a * cos(theta)
u <- a * sin(theta)
v <- c(0, u, -v, -u, v)
x <- c(0, v, u, -v, -u)
y <- cbind(x, y) / 1.03
pts <- hdelaunay(pts, centroids = TRUE, exact = TRUE)
hdel <- function(t){
fcolor <- colorRamp(trek_pal("klingon"))(t)
RGB rgb(RGB[, 1L], RGB[, 2L], RGB[, 3L], maxColorValue = 255)
}plotHdelaunay(
vertices = FALSE, circle = FALSE, color = fcolor
hdel, )
```