pub trait Trig {
fn sin(&self) -> Self;
fn asin(&self) -> Self;
fn sinh(&self) -> Self;
fn asinh(&self) -> Self;
fn cos(&self) -> Self;
fn acos(&self) -> Self;
fn cosh(&self) -> Self;
fn acosh(&self) -> Self;
fn tan(&self) -> Self;
fn atan(&self) -> Self;
fn tanh(&self) -> Self;
fn atanh(&self) -> Self;
fn atan2(&self, other: &Self) -> Self;
fn to_degrees(&self) -> Self;
fn to_radians(&self) -> Self;
}
fn sin(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::sin(&1_f32), 0.84147096_f32);
assert_eq!(Trig::sin(&1_f64), 0.8414709848078965_f64);
fn asin(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::asin(&1_f32), 1.5707964_f32);
assert_eq!(Trig::asin(&1_f64), 1.5707963267948966_f64);
fn sinh(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::sinh(&1_f32), 1.1752012_f32);
assert_eq!(Trig::sinh(&1_f64), 1.1752011936438014_f64);
fn asinh(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::asinh(&1_f32), 0.88137364_f32);
assert_eq!(Trig::asinh(&1_f64), 0.8813735870195429_f64);
fn cos(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::cos(&1_f32), 0.5403023_f32);
assert_eq!(Trig::cos(&1_f64), 0.5403023058681398_f64);
fn acos(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::acos(&1_f32), 0_f32);
assert_eq!(Trig::acos(&1_f64), 0_f64);
fn cosh(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::cosh(&1_f32), 1.5430806_f32);
assert_eq!(Trig::cosh(&1_f64), 1.5430806348152437_f64);
fn acosh(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::acosh(&1_f32), 0_f32);
assert_eq!(Trig::acosh(&1_f64), 0_f64);
fn tan(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::tan(&1_f32), 1.5574077_f32);
assert_eq!(Trig::tan(&1_f64), 1.5574077246549023_f64);
fn atan(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::atan(&1_f32), 0.7853982_f32);
assert_eq!(Trig::atan(&1_f64), 0.7853981633974483_f64);
fn tanh(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::tanh(&1_f32), 0.7615942_f32);
assert_eq!(Trig::tanh(&1_f64), 0.7615941559557649_f64);
fn atanh(&self) -> Self
use number_traits::Trig;
assert_eq!(Trig::atanh(&0_f32), 0_f32);
assert_eq!(Trig::atanh(&0_f64), 0_f64);
fn atan2(&self, other: &Self) -> Self
use number_traits::Trig;
assert_eq!(Trig::atan2(&1_f32, &1_f32), 0.7853982_f32);
assert_eq!(Trig::atan2(&1_f64, &1_f64), 0.7853981633974483_f64);
use number_traits::Trig;
use std::f32::consts::PI;
assert_eq!(Trig::to_degrees(&PI), 180_f32);
use number_traits::Trig;
use std::f32::consts::PI;
assert_eq!(Trig::to_radians(&180f32), PI);
impl Trig for usize
impl Trig for u8
impl Trig for u16
impl Trig for u32
impl Trig for u64
impl Trig for u128
impl Trig for isize
impl Trig for i8
impl Trig for i16
impl Trig for i32
impl Trig for i64
impl Trig for i128
impl Trig for f32
impl Trig for f64