[][src]Trait mathru::elementary::Trigonometry

pub trait Trigonometry {
    fn pi() -> Self;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn tan(self) -> Self;
fn cot(self) -> Self;
fn sec(self) -> Self;
fn csc(self) -> Self;
fn arcsin(self) -> Self;
fn arccos(self) -> Self;
fn arctan(self) -> Self;
fn arctan2(self, other: Self) -> Self;
fn arccot(self) -> Self;
fn arcsec(self) -> Self;
fn arccsc(self) -> Self; }

Required methods

fn pi() -> Self

Returns the mathematic constant PI

fn sin(self) -> Self

Sinus function

fn cos(self) -> Self

Cosinus function

fn tan(self) -> Self

Tangens function

fn cot(self) -> Self

Cotangens function

fn sec(self) -> Self

Secant function

fn csc(self) -> Self

Cosecant function

fn arcsin(self) -> Self

Inverse sinus function

fn arccos(self) -> Self

Inverse cosinus function

fn arctan(self) -> Self

Inverse tangens function

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

fn arccot(self) -> Self

Inverse cosecant function

fn arcsec(self) -> Self

Inverse secant function

fn arccsc(self) -> Self

Loading content...

Implementations on Foreign Types

impl Trigonometry for f32[src]

fn pi() -> Self[src]

Returns the mathematic constant PI

fn sin(self) -> Self[src]

Sinus

fn cos(self) -> Self[src]

Cosinus

fn tan(self) -> Self[src]

Tangens

fn sec(self) -> Self[src]

Secant

Panics

self = n pi + pi/2 n \in Z

fn arcsin(self) -> Self[src]

Inverse sine function

Arguemnts

-1.0 <= x <= 1.0

Panics

|x| > 1.0

fn arccos(self) -> Self[src]

Inverse cosine function

Arguemnts

-1.0 <= x <= 1.0

Panics

|x| > 1.0

fn arctan(self) -> Self[src]

Computes the arctangent of a number

fn arctan2(self, other: Self) -> Self[src]

Computes the arctangent

impl Trigonometry for f64[src]

fn pi() -> Self[src]

Returns the mathematic constant PI

fn sin(self) -> Self[src]

Sinus

fn cos(self) -> Self[src]

Cosinus

fn tan(self) -> Self[src]

Tangens

fn sec(self) -> Self[src]

Secant

Panics

self = n pi + pi/2 n \in Z

fn arcsin(self) -> Self[src]

Inverse sine function

Arguemnts

-1.0 <= x <= 1.0

Panics

|x| > 1.0

fn arccos(self) -> Self[src]

Inverse cosine function

Arguemnts

-1.0 <= x <= 1.0

Panics

|x| > 1.0

fn arctan(self) -> Self[src]

Computes the arctangent of a number

fn arctan2(self, other: Self) -> Self[src]

Computes the arctangent

Loading content...

Implementors

impl<T> Trigonometry for Complex<T> where
    T: Real
[src]

fn pi() -> Self[src]

Returns the mathematic constant PI, represented as a complex number

fn sin(self) -> Self[src]

Sinus function

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: f64 = 1.0;
let b: f64 = 2.0;
let z: Complex<f64> = Complex::new(a, b);
let re: f64 = (-(-b).exp() * a.sin() - b.exp() * a.sin()) / -2.0;
let im: f64 = ((-b).exp() * a.cos() - b.exp() * a.cos()) / -2.0;

let uut: Complex<f64> = z.sin();
let refer: Complex<f64> = Complex::new(re, im);

assert_eq!(refer, uut);

fn cos(self) -> Self[src]

Cosinus function

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: f64 = 1.0;
let b: f64 = 2.0;
let z: Complex<f64> = Complex::new(a, b);
let re: f64 = ((-b).exp() * a.cos() + b.exp() * (-a).cos()) / 2.0;
let im: f64 = ((-b).exp() * a.sin() + b.exp() * (-a).sin()) / 2.0;
let refer: Complex<f64> = Complex::new(re, im);

let uut: Complex<f64> = z.cos();

assert_eq!(refer, uut);

fn tan(self) -> Self[src]

Tangens function

Arguments

self \in \mathbb{C} \setminus { k\pi + \frac{\pi}{2} | k \in \mathbb{Z} }

Panics

if the argument bounds are not fulfilled

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: f64 = 1.0;
let b: f64 = 2.0;
let z: Complex<f64> = Complex::new(a, b);
let refer: Complex<f64> = z.sin() / z.cos();

let uut: Complex<f64> = z.tan();

assert_eq!(refer, uut);

fn cot(self) -> Self[src]

Cotangens function

Arguments

self: \mathbb{C} \setminus { \frac{k * \pi}{2} | k \in \mathbb{Z} }

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = Complex::new(1.0_f64, 0.0_f64) / a.tan();

assert_eq!(refer, a.cot());

fn sec(self) -> Self[src]

Secant function

Arguments

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = Complex::new(1.0_f64, 0.0_f64) / a.cos();

assert_eq!(refer, a.sec());

fn csc(self) -> Self[src]

Cosecant function

Arguments

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = Complex::new(1.0_f64, 0.0_f64) / a.sin();

assert_eq!(refer, a.csc());

fn arcsin(self) -> Self[src]

Inverse sinus function

Arguments

Panics

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = Complex::new(0.4270785863924768, 1.5285709194809995);

assert_eq!(refer, a.arcsin());

fn arccos(self) -> Self[src]

Inverse cosinus function

Arguments

Panics

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = Complex::new(std::f64::consts::PI / 2.0_f64, 0.0_f64) - a.arcsin();

assert_eq!(refer, a.arccos());

fn arctan(self) -> Self[src]

Inverse tangens function

Arguments

self: Complex numbers without {-i, i}

Panics

iff self = i or self = -i

Example

use mathru::{elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(0.0_f64, 2.0_f64);
let refer: Complex<f64> = Complex::new(std::f64::consts::PI / 2.0,
                                       (4.0_f64 / 5.0_f64).atanh() / 2.0_f64);

assert_eq!(refer, a.arctan());

fn arccot(self) -> Self[src]

Inverse cotangens function

Arguments

self: Complex numbers without {-i, i}

Panics

iff self = i or self = -i

Example

use mathru::{algebra::abstr::One, elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = (Complex::one() / a).arctan();

assert_eq!(refer, a.arccot());

fn arcsec(self) -> Self[src]

Inverse secant function

Arguments

self: Complex numbers without {-1, 0, 1}

Panics

iff self = -1 or self = 0 or self = 1

Example

use mathru::{algebra::abstr::One, elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = (Complex::one() / a).arccos();

assert_eq!(refer, a.arcsec());

fn arccsc(self) -> Self[src]

Inverse cosecant function

Arguments

Panics

Example

use mathru::{algebra::abstr::One, elementary::Trigonometry, num::Complex};

let a: Complex<f64> = Complex::new(1.0_f64, 2.0_f64);
let refer: Complex<f64> = (Complex::one() / a).arcsin();

assert_eq!(refer, a.arccsc());
Loading content...