Trait number_traits::Trig
[−]
[src]
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; }
Required Methods
fn sin(&self) -> Self
Examples
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
Examples
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
Examples
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
Examples
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
Examples
use number_traits::{ApproxEq, Trig}; assert!(ApproxEq::approx_eq_tolerance(&Trig::cos(&1_f32), &0.5403023_f32, &0.00001)); assert!(ApproxEq::approx_eq_tolerance(&Trig::cos(&1_f64), &0.5403023058681397_f64, &0.000000001));
fn acos(&self) -> Self
Examples
use number_traits::Trig; assert_eq!(Trig::acos(&1_f32), 0_f32); assert_eq!(Trig::acos(&1_f64), 0_f64);
fn cosh(&self) -> Self
Examples
use number_traits::{ApproxEq, Trig}; assert!(ApproxEq::approx_eq_tolerance(&Trig::cosh(&1_f32), &1.5430806_f32, &0.00001)); assert!(ApproxEq::approx_eq_tolerance(&Trig::cosh(&1_f64), &1.5430806348152437_f64, &0.000000001));
fn acosh(&self) -> Self
Examples
use number_traits::Trig; assert_eq!(Trig::acosh(&1_f32), 0_f32); assert_eq!(Trig::acosh(&1_f64), 0_f64);
fn tan(&self) -> Self
Examples
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
Examples
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
Examples
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
Examples
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
Examples
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);
fn to_degrees(&self) -> Self
Examples
use number_traits::Trig; use std::f32::consts::PI; assert_eq!(Trig::to_degrees(&PI), 180_f32);
fn to_radians(&self) -> Self
Examples
use number_traits::Trig; use std::f32::consts::PI; assert_eq!(Trig::to_radians(&180f32), PI);
Implementations on Foreign Types
impl<T> Trig for Wrapping<T> where
T: Trig,
[src]
T: Trig,
fn sin(&self) -> Self
[src]
fn asin(&self) -> Self
[src]
fn sinh(&self) -> Self
[src]
fn asinh(&self) -> Self
[src]
fn cos(&self) -> Self
[src]
fn acos(&self) -> Self
[src]
fn cosh(&self) -> Self
[src]
fn acosh(&self) -> Self
[src]
fn tan(&self) -> Self
[src]
fn atan(&self) -> Self
[src]
fn tanh(&self) -> Self
[src]
fn atanh(&self) -> Self
[src]
fn atan2(&self, other: &Self) -> Self
[src]
fn to_degrees(&self) -> Self
[src]
fn to_radians(&self) -> Self
[src]
Implementors
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