Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Give the distance between two points in hyperbolic space
ResourceFunction["HyperbolicDistance"][u,v,"metric"] gives the distance between vectors u and v in hyperbolic space, using the specified metric. |
"Beltrami" | Beltrami–Klein disk metric |
"HalfPlane" | Poincaré half-plane metric |
"Poincare" | Poincaré disk metric |
Distance between two vectors on the Poincaré disk:
In[1]:= | ![]() |
Out[1]= | ![]() |
Distance between numeric vectors on the Poincaré disk:
In[2]:= | ![]() |
Out[2]= | ![]() |
Distance between two points on the Beltrami–Klein ball:
In[3]:= | ![]() |
Out[3]= | ![]() |
Distance between two points in the Poincaré half-plane model:
In[4]:= | ![]() |
Out[4]= | ![]() |
Cluster data on the Poincaré ball:
In[5]:= | ![]() |
Out[5]= | ![]() |
Visualize the clusters:
In[6]:= | ![]() |
Out[6]= | ![]() |
If at least one of the points supplied is a point at infinity, HyperbolicDistance returns Infinity:
In[7]:= | ![]() |
Out[7]= | ![]() |
Visualize the Voronoi diagram of points on the Beltrami-Klein and Poincaré models:
In[8]:= | ![]() |
In[9]:= | ![]() |
Out[9]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License