Skip to main content

Const

Struct Const 

Source
pub struct Const;

Implementations§

Source§

impl Const

Source

pub const PI: f64 = std::f64::consts::PI

Source

pub const E: f64 = std::f64::consts::E

Source

pub const GOLDEN_RATIO: f64 = 1.618033988749895

Source

pub const SQRT_2: f64 = 1.4142135623730951

Source

pub const LN_2: f64 = 0.6931471805599453

Source

pub const LN_10: f64 = 2.302585092994046

Source

pub const EULER_MASCHERONI: f64 = 0.5772156649015329

Source

pub const SPEED_OF_LIGHT: f64 = 299_792_458.0

Source

pub const GRAVITATIONAL_CONSTANT: f64 = 6.674_30e-11

Source

pub const PLANCK_CONSTANT: f64 = 6.626_070_15e-34

Source

pub const REDUCED_PLANCK_CONSTANT: f64

Source

pub const BOLTZMANN_CONSTANT: f64 = 1.380_649e-23

Source

pub const ELEMENTARY_CHARGE: f64 = 1.602_176_634e-19

Source

pub const ELECTRON_MASS: f64 = 9.109_383_701_5e-31

Source

pub const PROTON_MASS: f64 = 1.672_621_923_69e-27

Source

pub const NEUTRON_MASS: f64 = 1.674_927_471_4e-27

Source

pub const AVOGADRO_CONSTANT: f64 = 6.022_140_76e23

Source

pub const VACUUM_PERMITTIVITY: f64 = 8.854_187_812_8e-12

Source

pub const VACUUM_PERMEABILITY: f64 = 1.256_637_062_12e-6

Source

pub const FINE_STRUCTURE_CONSTANT: f64 = 7.297_352_5693e-3

Source

pub const RYDBERG_CONSTANT: f64 = 10_973_731.568_160

Source

pub const ATOMIC_MASS_UNIT: f64 = 1.660_539_066_60e-27

Source

pub const FARADAY_CONSTANT: f64 = 96_485.332_123_1

Source

pub const GAS_CONSTANT: f64 = 8.314_462_618_153_24

Source

pub const STEFAN_BOLTZMANN_CONSTANT: f64 = 5.670_374_419e-8

Source

pub const WIEN_DISPLACEMENT_CONSTANT: f64 = 2.897_771_955e-3

Source

pub const ASTRONOMICAL_UNIT: f64 = 149_597_870_700.0

Source

pub const LIGHT_YEAR: f64 = 9.460_730_472_580_8e15

Source

pub const PARSEC: f64 = 3.085_677_581_491_367e16

Source

pub const SOLAR_MASS: f64 = 1.988_847e30

Source

pub const EARTH_MASS: f64 = 5.972_167e24

Source

pub const EARTH_RADIUS: f64 = 6.371e6

Source

pub const SOLAR_RADIUS: f64 = 6.957e8

Source

pub const HUBBLE_CONSTANT: f64 = 67.4

Source

pub fn pi(precision: Option<u32>) -> f64

Source

pub fn e(precision: Option<u32>) -> f64

Source

pub fn golden_ratio(precision: Option<u32>) -> f64

Source

pub fn sqrt_2(precision: Option<u32>) -> f64

Source

pub fn ln_2(precision: Option<u32>) -> f64

Source

pub fn ln_10(precision: Option<u32>) -> f64

Source

pub fn euler_mascheroni(precision: Option<u32>) -> f64

Source

pub fn speed_of_light(unit: Speed) -> Speed

Source

pub fn gravitational_constant(unit: Force) -> Force

Source

pub fn planck_constant(unit: Energy) -> Energy

Source

pub fn reduced_planck_constant(unit: Energy) -> Energy

Source

pub fn boltzmann_constant(unit: Energy) -> Energy

Source

pub fn elementary_charge(unit: ElectricCharge) -> ElectricCharge

Source

pub fn electron_mass(unit: Mass) -> Mass

Source

pub fn proton_mass(unit: Mass) -> Mass

Source

pub fn avogadro_constant(unit: Frequency) -> Frequency

Source

pub fn fine_structure_constant() -> f64

Source

pub fn rydberg_constant(unit: Frequency) -> Frequency

Source

pub fn atomic_mass_unit(unit: Mass) -> Mass

Source

pub fn faraday_constant(unit: ElectricCharge) -> ElectricCharge

Source

pub fn gas_constant(unit: Energy) -> Energy

Trait Implementations§

Source§

impl Clone for Const

Source§

fn clone(&self) -> Const

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Const

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Const

§

impl RefUnwindSafe for Const

§

impl Send for Const

§

impl Sync for Const

§

impl Unpin for Const

§

impl UnsafeUnpin for Const

§

impl UnwindSafe for Const

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.