The logarithm of a translator is a line with only degenerate components (e01, e02, e03). I called it an Ideal Line (name is taken from klein) as it is a line at infinity (a translation is a rotation around a line at infinity). The exponential of an Ideal Line is a translator again. Implementing Ln and Exp for Translator and IdealLine allows to write code generic over motor-like types.
#[test]
fn foo() {
let b = ppga3d:: IdealLine { g0: simd::Simd32x3 {
f32x3: [1.0, 2.0, 3.0]
} };
// A translator by 1 e1 units, 2 e2 units and 3 e3 units.
let t = b.exp();
// A translator by 0.5 e1 units, 1 e2 units and 1.5 e3 units.
let t_half = t.powf(0.5);
let b_half = t_half.ln();
unsafe { assert_eq!(
b_half.g0.f32x3,
[0.5, 1.0, 1.5]
) };
}
The logarithm of a translator is a line with only degenerate components (
e01
,e02
,e03
). I called it an Ideal Line (name is taken from klein) as it is a line at infinity (a translation is a rotation around a line at infinity). The exponential of an Ideal Line is a translator again. ImplementingLn
andExp
forTranslator
andIdealLine
allows to write code generic over motor-like types.