Implement exponential map for translator
This commit is contained in:
parent
4eca234241
commit
23959e1af8
2 changed files with 33 additions and 1 deletions
2
.github/workflows/actions.yaml
vendored
2
.github/workflows/actions.yaml
vendored
|
|
@ -36,7 +36,7 @@ jobs:
|
|||
- name: epga3d
|
||||
descriptor: "epga3d:1,1,1,1;Scalar:1;MultiVector:1,e23,-e13,e12|e0,-e023,e013,-e012|e123,e1,e2,e3|e0123,e01,e02,e03;Rotor:1,e23,-e13,e12;Point:e123,-e023,e013,-e012;Plane:e0,e1,e2,e3;Line:e01,e02,e03|e23,-e13,e12;Translator:1,e01,e02,e03;Motor:1,e23,-e13,e12|e0123,e01,e02,e03;PointAndPlane:e123,-e023,e013,-e012|e0,e1,e2,e3"
|
||||
- name: ppga3d
|
||||
descriptor: "ppga3d:0,1,1,1;Scalar:1;MultiVector:1,e23,-e13,e12|e0,-e023,e013,-e012|e123,e1,e2,e3|e0123,e01,e02,e03;Rotor:1,e23,-e13,e12;Point:e123,-e023,e013,-e012;Plane:e0,e1,e2,e3;Line:e01,e02,e03|e23,-e13,e12;Translator:1,e01,e02,e03;Motor:1,e23,-e13,e12|e0123,e01,e02,e03;PointAndPlane:e123,-e023,e013,-e012|e0,e1,e2,e3"
|
||||
descriptor: "ppga3d:0,1,1,1;Scalar:1;MultiVector:1,e23,-e13,e12|e0,-e023,e013,-e012|e123,e1,e2,e3|e0123,e01,e02,e03;Rotor:1,e23,-e13,e12;Point:e123,-e023,e013,-e012;Plane:e0,e1,e2,e3;Line:e01,e02,e03|e23,-e13,e12;Branch:e01,e02,e03;Translator:1,e01,e02,e03;Motor:1,e23,-e13,e12|e0123,e01,e02,e03;PointAndPlane:e123,-e023,e013,-e012|e0,e1,e2,e3"
|
||||
- name: hpga3d
|
||||
descriptor: "hpga3d:-1,1,1,1;Scalar:1;MultiVector:1,e23,-e13,e12|e0,-e023,e013,-e012|e123,e1,e2,e3|e0123,e01,e02,e03;Rotor:1,e23,-e13,e12;Point:e123,-e023,e013,-e012;Plane:e0,e1,e2,e3;Line:e01,e02,e03|e23,-e13,e12;Translator:1,e01,e02,e03;Motor:1,e23,-e13,e12|e0123,e01,e02,e03;PointAndPlane:e123,-e023,e013,-e012|e0,e1,e2,e3"
|
||||
steps:
|
||||
|
|
|
|||
32
src/lib.rs
32
src/lib.rs
|
|
@ -206,6 +206,38 @@ impl Powf for ppga3d::Motor {
|
|||
}
|
||||
}
|
||||
|
||||
impl Exp for ppga3d::Branch {
|
||||
type Output = ppga3d::Translator;
|
||||
|
||||
fn exp(self) -> ppga3d::Translator {
|
||||
ppga3d::Translator {
|
||||
g0: simd::Simd32x4 {
|
||||
f32x4: [1.0, self.g0[0], self.g0[1], self.g0[2]],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Ln for ppga3d::Translator {
|
||||
type Output = ppga3d::Branch;
|
||||
|
||||
fn ln(self) -> ppga3d::Branch {
|
||||
ppga3d::Branch {
|
||||
g0: simd::Simd32x3 {
|
||||
f32x3: [self.g0[1] / self.g0[0], self.g0[2] / self.g0[0], self.g0[3] / self.g0[0]],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Powf for ppga3d::Translator {
|
||||
type Output = Self;
|
||||
|
||||
fn powf(self, exponent: f32) -> Self {
|
||||
(ppga3d::Scalar { g0: exponent } * self.ln()).exp()
|
||||
}
|
||||
}
|
||||
|
||||
/// All elements set to `0.0`
|
||||
pub trait Zero {
|
||||
fn zero() -> Self;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue