Skip to content

Distinguish between orientation and rotation. #488

@porky11

Description

@porky11

I think, it would be useful to use different representations for orientation (absolute) and rotation (relative).

An orientation is there to rotate vectors and represents the current rotation of an object.
A rotation is there to rotate such objects.

Basically orientation should be represented by rotors (GA), which are isomorphic to complex numbers in 2D and to quaternions in 3D.
This way you can transform a lot of vectors without the need of recalculating the sine and cosine every time.

Rotation should be represented by bivectors (GA), which are isomorphic to scalars in 2D and to (normal) vectors in 3D.
They represent the plane of rotation. The magnitude represents the angle, the direction represents the direction. You can scale them as much as you want. Also multiple rotations along the same plane can always be represented.

A rotation (bivector) can be converted to an orientation (rotor) using sine an cosine:

impl RotationND {
    fn to_orientation(self) -> OrientationND {
        let (imaginary_factor, scalar) = self.magnitude().sin_cos();
        OrientationND {
            scalar,
            imaginary: self.normalized() * imaginary_factor,
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions