{"action":"created","issue":{"url":"https://api.github.com/repos/bjz/cgmath-rs/issues/285","labels_url":"https://api.github.com/repos/bjz/cgmath-rs/issues/285/labels{/name}","comments_url":"https://api.github.com/repos/bjz/cgmath-rs/issues/285/comments","events_url":"https://api.github.com/repos/bjz/cgmath-rs/issues/285/events","html_url":"https://github.com/bjz/cgmath-rs/issues/285","id":123592856,"number":285,"title":"output from from_euler for quaternions does not match from_angle_* functions","user":{"login":"DerekBurch","id":3202346,"avatar_url":"https://avatars.githubusercontent.com/u/3202346?v=3","gravatar_id":"","url":"https://api.github.com/users/DerekBurch","html_url":"https://github.com/DerekBurch","followers_url":"https://api.github.com/users/DerekBurch/followers","following_url":"https://api.github.com/users/DerekBurch/following{/other_user}","gists_url":"https://api.github.com/users/DerekBurch/gists{/gist_id}","starred_url":"https://api.github.com/users/DerekBurch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerekBurch/subscriptions","organizations_url":"https://api.github.com/users/DerekBurch/orgs","repos_url":"https://api.github.com/users/DerekBurch/repos","events_url":"https://api.github.com/users/DerekBurch/events{/privacy}","received_events_url":"https://api.github.com/users/DerekBurch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-23T02:33:19Z","updated_at":"2015-12-23T06:36:42Z","closed_at":null,"body":"Currently the x, y, z in the function `from_euler(x: Rad<S>, y: Rad<S>, z: Rad<S>)` do not correspond with the functions `from_angle_x`, `from_angle_y`, and `from_angle_z`.\r\n\r\nFor example, I would expect the following tests to succeed, but they currently fail.\r\n```\r\n#[test]\r\nfn test_quaternion_euler_angle_x()\r\n{\r\n    let angle = rad(1.0);\r\n    let q1: Quaternion<f32> = Rotation3::from_euler(angle, rad(0.0), rad(0.0));\r\n    let q2: Quaternion<f32> = Rotation3::from_angle_x(angle);\r\n    assert_approx_eq!(&q1, &q2);\r\n}\r\n\r\n#[test]\r\nfn test_quaternion_euler_angle_y()\r\n{\r\n    let angle = rad(1.0);\r\n    let q1: Quaternion<f32> = Rotation3::from_euler(rad(0.0), angle, rad(0.0));\r\n    let q2: Quaternion<f32> = Rotation3::from_angle_y(angle);\r\n    assert_approx_eq!(&q1, &q2);\r\n}\r\n\r\n#[test]\r\nfn test_quaternion_euler_angle_z()\r\n{\r\n    let angle = rad(1.0);\r\n    let q1: Quaternion<f32> = Rotation3::from_euler(rad(0.0), rad(0.0), angle);\r\n    let q2: Quaternion<f32> = Rotation3::from_angle_z(angle);\r\n    assert_approx_eq!(&q1, &q2);\r\n}\r\n```\r\n\r\nIf the x and z are swapped in the call to from_euler then this test will pass (when maybe it shouldn't?)\r\n```\r\n#[test]\r\nfn test_quaternion_euler_angle_x_z_swap()\r\n{\r\n    let angle = rad(1.0);\r\n    let q1: Quaternion<f32> = Rotation3::from_euler(rad(0.0), rad(0.0), angle);\r\n    let q2: Quaternion<f32> = Rotation3::from_angle_x(angle);\r\n    assert_approx_eq!(&q1, &q2);\r\n}\r\n```\r\n\r\nThe behavior for Matrix3 is different and all of the following tests pass\r\n```\r\n#[test]\r\nfn test_matrix3_euler_angle_x()\r\n{\r\n    let angle = rad(1.0);\r\n    let b1: Matrix3<f32> = Matrix3::from_euler(angle, rad(0.0), rad(0.0));\r\n    let b2: Matrix3<f32> = Matrix3::from_angle_x(angle);\r\n    assert_approx_eq!(&b1, &b2);\r\n}\r\n\r\n#[test]\r\nfn test_matrix3_euler_angle_y()\r\n{\r\n    let angle = rad(1.0);\r\n    let b1: Matrix3<f32> = Matrix3::from_euler(rad(0.0), angle, rad(0.0));\r\n    let b2: Matrix3<f32> = Matrix3::from_angle_y(angle);\r\n    assert_approx_eq!(&b1, &b2);\r\n}\r\n\r\n#[test]\r\nfn test_matrix3_euler_angle_z()\r\n{\r\n    let angle = rad(1.0);\r\n    let b1: Matrix3<f32> = Matrix3::from_euler(rad(0.0), rad(0.0), angle);\r\n    let b2: Matrix3<f32> = Matrix3::from_angle_z(angle);\r\n    assert_approx_eq!(&b1, &b2);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/bjz/cgmath-rs/issues/comments/166814384","html_url":"https://github.com/bjz/cgmath-rs/issues/285#issuecomment-166814384","issue_url":"https://api.github.com/repos/bjz/cgmath-rs/issues/285","id":166814384,"user":{"login":"bjz","id":695077,"avatar_url":"https://avatars.githubusercontent.com/u/695077?v=3","gravatar_id":"","url":"https://api.github.com/users/bjz","html_url":"https://github.com/bjz","followers_url":"https://api.github.com/users/bjz/followers","following_url":"https://api.github.com/users/bjz/following{/other_user}","gists_url":"https://api.github.com/users/bjz/gists{/gist_id}","starred_url":"https://api.github.com/users/bjz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjz/subscriptions","organizations_url":"https://api.github.com/users/bjz/orgs","repos_url":"https://api.github.com/users/bjz/repos","events_url":"https://api.github.com/users/bjz/events{/privacy}","received_events_url":"https://api.github.com/users/bjz/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T06:36:42Z","updated_at":"2015-12-23T06:36:42Z","body":"By the way, you can enable code highlighting on your fenced cod blocks by doing:\r\n\r\n~~~md\r\n```rust\r\nfn foo() { }\r\n```\r\n~~~"}}