Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish between orientation and rotation. #488

Open
porky11 opened this issue Nov 5, 2021 · 0 comments
Open

Distinguish between orientation and rotation. #488

porky11 opened this issue Nov 5, 2021 · 0 comments

Comments

@porky11
Copy link

porky11 commented Nov 5, 2021

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,
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant