src/manifold.rs

Mon, 21 Oct 2024 10:02:57 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 21 Oct 2024 10:02:57 -0500
changeset 7
8979a6638424
parent 6
df9628092285
child 8
17d71ca4ce84
permissions
-rw-r--r--

A simple test

5
f248e1434c3b Some distance functions etc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
1
f248e1434c3b Some distance functions etc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
2 use alg_tools::euclidean::Euclidean;
0
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
3
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
4 /// A point on a manifold
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
5 pub trait ManifoldPoint : Clone + PartialEq {
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
6 // Type of tangent factors
3
ff4656da04af Sketch exp
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
7 type Tangent : Euclidean<f64, Output=Self::Tangent> + std::fmt::Debug;
0
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
8
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
9 /// Exponential map
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
10 fn exp(&self, tangent : &Self::Tangent) -> Self;
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
11
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
12 /// Logarithmic map
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
13 fn log(&self, other : &Self) -> Self::Tangent;
5
f248e1434c3b Some distance functions etc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
14
f248e1434c3b Some distance functions etc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
15 /// Distance to `other`
f248e1434c3b Some distance functions etc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
16 fn dist_to(&self, other : &Self) -> f64;
6
df9628092285 Add a zero function on manifolds
Tuomo Valkonen <tuomov@iki.fi>
parents: 5
diff changeset
17
df9628092285 Add a zero function on manifolds
Tuomo Valkonen <tuomov@iki.fi>
parents: 5
diff changeset
18 /// Return the zero tangent at `self`.
df9628092285 Add a zero function on manifolds
Tuomo Valkonen <tuomov@iki.fi>
parents: 5
diff changeset
19 fn tangent_origin(&self) -> Self::Tangent;
0
989e2fe08db2 Basic cube logarithm
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
20 }
5
f248e1434c3b Some distance functions etc.
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
21
7
8979a6638424 A simple test
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
22 /// Point on a manifold that possesses displayable embedded coordinates.
8979a6638424 A simple test
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
23 pub trait EmbeddedManifoldPoint : ManifoldPoint + std::fmt::Debug {
8979a6638424 A simple test
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
24 type EmbeddedCoords : std::fmt::Display;
8979a6638424 A simple test
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
25
8979a6638424 A simple test
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
26 /// Convert a point on a manifold into embedded coordinates
8979a6638424 A simple test
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
27 fn embedded_coords(&self) -> Self::EmbeddedCoords;
8979a6638424 A simple test
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
28 }

mercurial