1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! [![github]](https://github.com/tamaskis/trig) [![crates-io]](https://crates.io/crates/trig) [![docs-rs]](https://docs.rs/trig)
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
//!
//! Complete set of trigonometric and hyperbolic functions in Rust.
//!
//! # Summary
//!
//! This crate defines the [`Trig`] trait defining the complete set of trigonometric and hyperbolic
//! functions. Rust already provides the following functions for [`f32`]s and [`f64`]s:
//!
//! * trigonometric functions (radians): `sin`, `cos`, `tan`
//! * inverse trigonometric functions (radians): `asin`, `acos`, `atan`, `atan2`
//! * hyperbolic functions: `sinh`, `cosh`, `tanh`
//! * inverse hyperbolic functions: `asinh`, `acosh`, `atanh`
//!
//! In addition to these functions, the [`Trig`] trait also defines the reciprocal functions and
//! their inverses for both the trigonometric and hyperbolic functions. The complete set of methods
//! defined on the [`Trig`] trait is:
//!
//! * trigonometric functions (radians): `sin`, `cos`, `tan`, `csc`, `sec`, `cot`
//! * inverse trigonometric functions (radians): `asin`, `acos`, `atan`, `acsc`, `asec`, `acot`
//! * trigonometric functions (degrees): `sind`, `cosd`, `tand`, `cscd`, `secd`, `cotd`
//! * inverse trigonometric functions (degrees): `asind`, `acosd`, `atand`, `atan2d`, `acscd`,
//! `asecd`, `acotd`
//! * hyperbolic functions: `sinh`, `cosh`, `tanh`, `csch`, `sech`, `coth`
//! * inverse hyperbolic functions: `asinh`, `acosh`, `atanh`, `acsch`, `asech`, `acoth`
//! * unit conversions: `deg2rad`, `rad2deg`
//!
//! # Implementations
//!
//! This crate currently implements the [`Trig`] trait for the following types/structs:
//!
//! * [`f32`]
//! * [`f64`]
//!
//! # Example
//!
//! ```
//! use trig::Trig;
//!
//! let x = std::f64::consts::FRAC_PI_2;
//! let abs_difference = (x.csc() - 1.0).abs();
//!
//! assert!(abs_difference < 1e-16);
//! ```
// Linter setup.
// Module declarations.
pub
pub
pub
// Re-exports.
pub use crateTrig;