src/manifold.rs

Sat, 19 Oct 2024 10:46:13 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sat, 19 Oct 2024 10:46:13 -0500
changeset 5
f248e1434c3b
parent 3
ff4656da04af
child 6
df9628092285
permissions
-rw-r--r--

Some distance functions etc.


use alg_tools::euclidean::Euclidean;

/// A point on a manifold
pub trait ManifoldPoint : Clone + PartialEq {
    // Type of tangent factors
    type Tangent : Euclidean<f64, Output=Self::Tangent> + std::fmt::Debug;

    /// Exponential map
    fn exp(&self, tangent : &Self::Tangent) -> Self;

    /// Logarithmic map
    fn log(&self, other : &Self) -> Self::Tangent;

    /// Distance to `other`
    fn dist_to(&self, other : &Self) -> f64;
}

mercurial