use na::{self, Real, DefaultAllocator}; use aliases::Vec; use traits::{Alloc, Dimension}; /// Componentwise arc-cosinus. pub fn acos(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.acos()) } /// Componentwise hyperbolic arc-cosinus. pub fn acosh(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.acosh()) } /// Componentwise arc-sinus. pub fn asin(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.asin()) } /// Componentwise hyperbolic arc-sinus. pub fn asinh(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.asinh()) } /// Componentwise arc-tangent of `y / x`. pub fn atan2(y: &Vec, x: &Vec) -> Vec where DefaultAllocator: Alloc { y.zip_map(x, |y, x| y.atan2(x)) } /// Componentwise arc-tangent. pub fn atan(y_over_x: &Vec) -> Vec where DefaultAllocator: Alloc { y_over_x.map(|e| e.atan()) } /// Componentwise hyperbolic arc-tangent. pub fn atanh(x: &Vec) -> Vec where DefaultAllocator: Alloc { x.map(|e| e.atanh()) } /// Componentwise cosinus. pub fn cos(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.cos()) } /// Componentwise hyperbolic cosinus. pub fn cosh(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.cosh()) } /// Componentwise conversion from radians to degrees. pub fn degrees(radians: &Vec) -> Vec where DefaultAllocator: Alloc { radians.map(|e| e * na::convert(180.0) / N::pi()) } /// Componentwise conversion fro degrees to radians. pub fn radians(degrees: &Vec) -> Vec where DefaultAllocator: Alloc { degrees.map(|e| e * N::pi() / na::convert(180.0)) } /// Componentwise sinus. pub fn sin(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.sin()) } /// Componentwise hyperbolic sinus. pub fn sinh(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.sinh()) } /// Componentwise tangent. pub fn tan(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.tan()) } /// Componentwise hyperbolic tangent. pub fn tanh(angle: &Vec) -> Vec where DefaultAllocator: Alloc { angle.map(|e| e.tanh()) }