Capitalize Euler.

This commit is contained in:
Bruce Mitchener 2018-10-16 21:48:31 +07:00 committed by Sébastien Crozet
parent 47fe851173
commit 924a9cd160
2 changed files with 7 additions and 5 deletions

View File

@ -1,11 +1,13 @@
use na::{self, Real}; use na::{self, Real};
/// The euler constant. /// The Euler constant.
///
/// This is a shorthand alias for [`euler`](fn.euler.html).
pub fn e<N: Real>() -> N { pub fn e<N: Real>() -> N {
N::e() N::e()
} }
/// The euler constant. /// The Euler constant.
pub fn euler<N: Real>() -> N { pub fn euler<N: Real>() -> N {
N::e() N::e()
} }

View File

@ -50,19 +50,19 @@ pub fn quat_look_at_rh<N: Real>(direction: &TVec3<N>, up: &TVec3<N>) -> Qua<N> {
UnitQuaternion::look_at_rh(direction, up).unwrap() UnitQuaternion::look_at_rh(direction, up).unwrap()
} }
/// The "roll" euler angle of the quaternion `x` assumed to be normalized. /// The "roll" Euler angle of the quaternion `x` assumed to be normalized.
pub fn quat_roll<N: Real>(x: &Qua<N>) -> N { pub fn quat_roll<N: Real>(x: &Qua<N>) -> N {
// FIXME: optimize this. // FIXME: optimize this.
quat_euler_angles(x).z quat_euler_angles(x).z
} }
/// The "yaw" euler angle of the quaternion `x` assumed to be normalized. /// The "yaw" Euler angle of the quaternion `x` assumed to be normalized.
pub fn quat_yaw<N: Real>(x: &Qua<N>) -> N { pub fn quat_yaw<N: Real>(x: &Qua<N>) -> N {
// FIXME: optimize this. // FIXME: optimize this.
quat_euler_angles(x).y quat_euler_angles(x).y
} }
/// The "pitch" euler angle of the quaternion `x` assumed to be normalized. /// The "pitch" Euler angle of the quaternion `x` assumed to be normalized.
pub fn quat_pitch<N: Real>(x: &Qua<N>) -> N { pub fn quat_pitch<N: Real>(x: &Qua<N>) -> N {
// FIXME: optimize this. // FIXME: optimize this.
quat_euler_angles(x).x quat_euler_angles(x).x