Skip to main content

hyperbolic_distance

Function hyperbolic_distance 

Source
pub fn hyperbolic_distance(a: &[f32], b: &[f32], curvature: f32) -> f32
Expand description

Compute the hyperbolic distance between two points on the Poincaré ball.

d(x, y) = (1/√c) * arcosh(1 + 2c * δ(x, y) / ((1 - c||x||²)(1 - c||y||²)))

where δ(x, y) = ||x - y||²