Translator
group translator
A translator represents a rigid-body displacement along a normalized axis. To apply the translator to a supported entity, the call operator is available.
Example
// Initialize a point at (1, 3, 2)
kln::point p{1.f, 3.f, 2.f};
// Create a normalized translator representing a 4-unit
// displacement along the xz-axis.
kln::translator r{4.f, 1.f, 0.f, 1.f};
// Displace our point using the created translator
kln::point translated = r(p);
Translators can be multiplied to one another with the *
operator to create a new translator equivalent to the application of each factor.
Example
// Suppose we have 3 translators t1, t2, and t3
// The translator t created here represents the combined action of
// t1, t2, and t3.
kln::translator t = t3 * t2 * t1;
The same *
operator can be used to compose the translator's action with other rotors and motors.
Summary
Members | Descriptions |
---|---|
public translator () = default |
|
public translator (float delta,float x,float y,float z) noexcept |
|
public void load_normalized (float * data) noexcept |
Fast load operation for packed data that is already normalized. The argument data should point to a set of 4 float values with layout (0.f, a, b, c) corresponding to the multivector \(a\mathbf{e}_{01} + b\mathbf{e}_{02} + c\mathbf{e}_{03}\). |
public void invert () noexcept |
|
public translator inverse () const noexcept |
|
public plane KLN_VEC_CALL operator() (plane const & p) const noexcept |
Conjugates a plane \(p\) with this translator and returns the result \(tp\widetilde{t}\). |
public line KLN_VEC_CALL operator() (line const & l) const noexcept |
Conjugates a line \(\ell\) with this translator and returns the result \(t\ell\widetilde{t}\). |
public point KLN_VEC_CALL operator() (point const & p) const noexcept |
Conjugates a point \(p\) with this translator and returns the result \(tp\widetilde{t}\). |
public translator &KLN_VEC_CALL operator+= (translator b) noexcept |
Translator addition. |
public translator &KLN_VEC_CALL operator-= (translator b) noexcept |
Translator subtraction. |
public translator & operator*= (float s) noexcept |
Translator uniform scale. |
public translator & operator*= (int s) noexcept |
Translator uniform scale. |
public translator & operator/= (float s) noexcept |
Translator uniform inverse scale. |
public translator & operator/= (int s) noexcept |
Translator uniform inverse scale. |
public constexpr float scalar () const noexcept |
|
public float e01 () const noexcept |
|
public float e10 () const noexcept |
|
public float e02 () const noexcept |
|
public float e20 () const noexcept |
|
public float e03 () const noexcept |
|
public float e30 () const noexcept |
|
public translator KLN_VEC_CALL operator+ (translator a,translator b) noexcept |
Translator addition. |
public translator KLN_VEC_CALL operator- (translator a,translator b) noexcept |
Translator subtraction. |
public translator KLN_VEC_CALL operator* (translator t,float s) noexcept |
Translator uniform scale. |
public translator KLN_VEC_CALL operator* (translator t,int s) noexcept |
Translator uniform scale. |
public translator KLN_VEC_CALL operator* (float s,translator t) noexcept |
Translator uniform scale. |
public translator KLN_VEC_CALL operator* (int s,translator t) noexcept |
Translator uniform scale. |
public translator KLN_VEC_CALL operator/ (translator t,float s) noexcept |
Translator uniform inverse scale. |
public translator KLN_VEC_CALL operator/ (translator t,int s) noexcept |
Translator uniform inverse scale. |
Members
translator() = default
translator(float delta,float x,float y,float z) noexcept
void load_normalized(float * data) noexcept
Fast load operation for packed data that is already normalized. The argument data
should point to a set of 4 float values with layout (0.f, a, b, c)
corresponding to the multivector \(a\mathbf{e}_{01} + b\mathbf{e}_{02} + c\mathbf{e}_{03}\).
Danger
The translator data loaded this way must be normalized. That is, the quantity \(-\sqrt{a^2 + b^2 + c^2}\) must be half the desired displacement.
void invert() noexcept
translator inverse() const noexcept
plane KLN_VEC_CALL operator()(plane const & p) const noexcept
Conjugates a plane \(p\) with this translator and returns the result \(tp\widetilde{t}\).
line KLN_VEC_CALL operator()(line const & l) const noexcept
Conjugates a line \(\ell\) with this translator and returns the result \(t\ell\widetilde{t}\).
point KLN_VEC_CALL operator()(point const & p) const noexcept
Conjugates a point \(p\) with this translator and returns the result \(tp\widetilde{t}\).
translator &KLN_VEC_CALL operator+=(translator b) noexcept
Translator addition.
translator &KLN_VEC_CALL operator-=(translator b) noexcept
Translator subtraction.
translator & operator*=(float s) noexcept
Translator uniform scale.
translator & operator*=(int s) noexcept
Translator uniform scale.
translator & operator/=(float s) noexcept
Translator uniform inverse scale.
translator & operator/=(int s) noexcept
Translator uniform inverse scale.
float scalar() const noexcept
float e01() const noexcept
float e10() const noexcept
float e02() const noexcept
float e20() const noexcept
float e03() const noexcept
float e30() const noexcept
translator KLN_VEC_CALL operator+(translator a,translator b) noexcept
Translator addition.
translator KLN_VEC_CALL operator-(translator a,translator b) noexcept
Translator subtraction.
translator KLN_VEC_CALL operator*(translator t,float s) noexcept
Translator uniform scale.
translator KLN_VEC_CALL operator*(translator t,int s) noexcept
Translator uniform scale.
translator KLN_VEC_CALL operator*(float s,translator t) noexcept
Translator uniform scale.
translator KLN_VEC_CALL operator*(int s,translator t) noexcept
Translator uniform scale.
translator KLN_VEC_CALL operator/(translator t,float s) noexcept
Translator uniform inverse scale.
translator KLN_VEC_CALL operator/(translator t,int s) noexcept
Translator uniform inverse scale.