com_croftsoft_core/math/math_constants/
mod.rs

1// =============================================================================
2//! - A collection of math constants
3//!
4//! # Metadata
5//! - Copyright: © 1999 - 2022 [`CroftSoft Inc`]
6//! - Author: [`David Wallace Croft`]
7//! - Rust version: 2022-08-09
8//! - Rust since: 2022-07-30
9//! - Java version: 2002-01-27
10//!
11//! # History
12//! - Adapted from the Java class com.croftsoft.core.math.MathConstants
13//!   - In the Java-based [`CroftSoft Core Library`]
14//!
15//! [`CroftSoft Core Library`]: https://www.croftsoft.com/library/code/
16//! [`CroftSoft Inc`]: https://www.croftsoft.com/
17//! [`David Wallace Croft`]: https://www.croftsoft.com/people/david/
18// =============================================================================
19
20use core::f64::consts::TAU;
21
22pub const DEGREES_PER_RADIAN: f64 = 360.0 / TAU;
23pub const GOLDEN_RATIO: f64 = 1.618_033_988_749_895;
24pub const SECONDS_PER_NANOSECOND: f64 = 0.000_000_001;
25pub const MILLISECONDS_PER_DAY: u64 = 1_000 * 60 * 60 * 24;
26pub const MILLISECONDS_PER_SECOND: u64 = 1_000;
27pub const NANOSECONDS_PER_MICROSECOND: u64 = 1_000;
28pub const NANOSECONDS_PER_MILLISECOND: u64 = 1_000_000;
29pub const NANOSECONDS_PER_SECOND: u64 = 1_000_000_000;