Skip to content

Euler/Quaternion conversion do not wrap over -90 #563

@kkolyan

Description

@kkolyan

Seems like it somewhere clamping to [90;-90]

    use cgmath::Deg;
    use cgmath::Euler;
    use cgmath::Quaternion;
    use cgmath::Rotation3;

    #[test]
    fn test1() {
        let b = Deg(-91.234);
        assert_eq!(b.0, -91.234);
        let q = Quaternion::from_angle_y(b);
        let c = Euler::from(q);
        /*
        assertion `left == right` failed
          left: -91.234°
         right: -90.0°
         */
        assert_eq!(Deg(-91.234), Deg::from(c.y))
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions