Skip to main content

Trig

Trait Trig 

Source
pub trait Trig: Real {
    // Required methods
    fn sin(self) -> Self;
    fn cos(self) -> Self;
    fn tan(self) -> Self;
    fn asin(self) -> Self;
    fn acos(self) -> Self;
    fn atan(self) -> Self;
    fn atan2(self, other: Self) -> Self;
    fn sin_cos(self) -> (Self, Self);
    fn hypot(self, other: Self) -> Self;
}
Expand description

Trigonometric functions (radians).

Required Methods§

Source

fn sin(self) -> Self

Sine.

Source

fn cos(self) -> Self

Cosine.

Source

fn tan(self) -> Self

Tangent.

Source

fn asin(self) -> Self

Arcsine.

Source

fn acos(self) -> Self

Arccosine.

Source

fn atan(self) -> Self

Arctangent.

Source

fn atan2(self, other: Self) -> Self

Two-argument arctangent: atan(self / other).

Source

fn sin_cos(self) -> (Self, Self)

Sine and cosine simultaneously.

Source

fn hypot(self, other: Self) -> Self

Hypotenuse: sqrt(self^2 + other^2).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Trig for f32

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Source§

fn sin_cos(self) -> (Self, Self)

Source§

fn hypot(self, other: Self) -> Self

Source§

impl Trig for f64

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn atan2(self, other: Self) -> Self

Source§

fn sin_cos(self) -> (Self, Self)

Source§

fn hypot(self, other: Self) -> Self

Implementors§