Skip to content

ENH: Force real part of Rotation.as_quat() to be positive. #17024

@alexander-soare

Description

@alexander-soare

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like.

I think that any return value of Rotation.as_quat() should have a non-negative real component. This means we don't have to worry about the fact that quaternions are a double cover on SO(3) and we can always predict what the quaternion components will be given a rotation.

Describe alternatives you've considered.

Consider a Rotation instance: r = Rotation.random(). And consider the quaternion components I get from it: q = r.as_quat(). I can force the real part to be positive without changing the physical significance of the quaternion

if q[-1] < 0:
    q = -q

Additional context (e.g. screenshots, GIFs)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions