Skip to main content

Crate use_physics

Crate use_physics 

Source
Expand description

§use-physics

Feature-gated facade for the focused RustUse physics crates.

§Install

[dependencies]
use-physics = { version = "0.0.1", default-features = false, features = ["gravity", "orbit", "momentum", "collision", "oscillation", "elasticity", "relativity", "quantum", "plasma", "electricity", "magnetism", "electromagnetism", "particle", "nuclear", "radiation", "work"] }

§Foundation

use-physics re-exports focused f64-first physics helpers behind opt-in features. The facade stays thin, mirrors the boundaries of the concrete crates, and exposes each enabled crate under a matching module such as use_physics::gravity, use_physics::orbit, use_physics::momentum, use_physics::collision, use_physics::oscillation, use_physics::elasticity, use_physics::rigidbody, use_physics::statics, use_physics::relativity, use_physics::quantum, use_physics::plasma, use_physics::electricity, use_physics::magnetism, use_physics::electromagnetism, use_physics::particle, use_physics::nuclear, use_physics::radiation, or use_physics::work.

When focused crates would otherwise collide at the root, the facade keeps explicit aliases or module boundaries. For example, enabling both force and momentum preserves use-force’s impulse export and re-exports the force-time helper from use-momentum as momentum_impulse. Enabling both collision and energy keeps the existing root kinetic_energy export from use-energy and re-exports the collision crate’s version as collision_kinetic_energy. Enabling both pressure and fluid keeps use-pressure’s hydrostatic_pressure export at the root and re-exports the fluid-specific helper as fluid_hydrostatic_pressure. Enabling both torque and statics keeps the established root is_rotational_equilibrium export from use-torque and re-exports the statics version as statics_is_rotational_equilibrium. Enabling orbit alongside gravity or force keeps the existing root GRAVITATIONAL_CONSTANT, STANDARD_GRAVITY, and circular_orbital_period behavior, while the overlapping orbit variants remain available under use_physics::orbit. Enabling oscillation keeps use-motion’s root displacement export and use-work’s root spring_potential_energy export unchanged while exposing the oscillation variants as oscillation_displacement and oscillation_spring_potential_energy. Enabling rigidbody alongside rotation or torque keeps the established root angular-momentum, rotational-energy, and moment-of-inertia exports in place while re-exporting the rigid-body variants as rigidbody_... aliases when those names would collide. Enabling electromagnetism alongside magnetism or nuclear keeps the existing VACUUM_PERMEABILITY and SPEED_OF_LIGHT exports at the root and re-exports the electromagnetism versions as ELECTROMAGNETISM_VACUUM_PERMEABILITY and ELECTROMAGNETISM_SPEED_OF_LIGHT. Enabling relativity alongside electromagnetism or nuclear keeps the existing root SPEED_OF_LIGHT export and re-exports the relativity version as RELATIVITY_SPEED_OF_LIGHT. Enabling quantum alongside a crate that already owns the root SPEED_OF_LIGHT export keeps that existing root behavior and re-exports the quantum version as QUANTUM_SPEED_OF_LIGHT. Enabling plasma alongside quantum, electromagnetism, or magnetism keeps the established root ELEMENTARY_CHARGE, ELECTRON_MASS, VACUUM_PERMITTIVITY, VACUUM_PERMEABILITY, and magnetic_pressure exports and re-exports the plasma variants as PLASMA_ELEMENTARY_CHARGE, PLASMA_ELECTRON_MASS, PLASMA_VACUUM_PERMITTIVITY, PLASMA_VACUUM_PERMEABILITY, and plasma_magnetic_pressure. Enabling radiation keeps the focused crate available under use_physics::radiation, exposes the overlapping convenience constants as RADIATION_SPEED_OF_LIGHT and RADIATION_JOULES_PER_MEV, and leaves the overlapping photon-constant and photon-energy helpers on the namespaced use_physics::radiation module. Likewise, the full use-work surface stays available under use_physics::work while the existing root work export continues to come from use-energy.

§Example

use use_physics::{MagneticField, magnetic_flux};

assert_eq!(magnetic_flux(2.0, 3.0, 0.0), Some(6.0));
assert_eq!(
	MagneticField::new(3.0)
		.and_then(|field| field.energy_density())
		.map(|value| value > 0.0),
	Some(true)
);

§When to use directly

Choose use-physics when you want one dependency and one import surface. Prefer the focused crates directly when you only need one physics domain.

§Scope

  • The facade stays close to the focused crate APIs.
  • Feature flags map directly to the focused crates in this workspace.
  • Units systems and symbolic algebra are out of scope.

§Status

use-physics is a pre-1.0 crate with a deliberately small facade over focused helpers. Facade for RustUse physics helpers.

Re-exports§

pub use use_density as density;
pub use use_elasticity as elasticity;
pub use use_energy as energy;
pub use use_collision as collision;
pub use use_fluid as fluid;
pub use use_electricity as electricity;
pub use use_magnetism as magnetism;
pub use use_electromagnetism as electromagnetism;
pub use use_quantum as quantum;
pub use use_plasma as plasma;
pub use use_force as force;
pub use use_torque as torque;
pub use use_statics as statics;
pub use use_gravity as gravity;
pub use use_orbit as orbit;
pub use use_momentum as momentum;
pub use use_relativity as relativity;
pub use use_motion as motion;
pub use use_oscillation as oscillation;
pub use use_rotation as rotation;
pub use use_rigidbody as rigidbody;
pub use use_particle as particle;
pub use use_nuclear as nuclear;
pub use use_radiation as radiation;
pub use use_power as power;
pub use use_pressure as pressure;
pub use use_thermodynamics as thermodynamics;

Modules§

prelude
work

Structs§

AngularState
A scalar angular position and angular velocity pair.
CantileverReaction
Fixed-end reaction data for a cantilever with a free-end point load.
CentralBody
Mass and optional radius for a central body used in orbital calculations.
Collision1D
A one-dimensional collision configuration with two bodies and a restitution coefficient.
CollisionBody1D
A one-dimensional body with scalar mass and velocity.
ConstantForceWork
Constant-force work inputs for repeated calculations.
DecayLaw
Simple exponential-decay law parameterized by a decay constant.
Dose
A simple absorbed dose wrapper in gray.
ElasticBar
Simple uniform elastic bar properties for axial loading summaries.
ElasticMaterial
Simple elastic material parameters for linear isotropic summaries.
ElectricalLoad
A simple electrical load described by voltage and resistance.
ElectromagneticField
A scalar electric and magnetic field pair.
ElectronPlasma
A simple electron-plasma state.
ElementaryCharge
An exact electric charge expressed in thirds of the elementary charge.
EllipticalOrbit
Elliptical orbit state described by a gravitational parameter and apsides.
Fluid
A simple fluid model with density and optional dynamic viscosity.
Force2D
A validated planar force value.
GravityBody
Mass and radius for a body used in gravity calculations.
LeverForce
A force applied at a lever arm.
MagneticField
A simple magnetic field described by flux density.
MassProperties
Mass and rotational inertia for a scalar rigid body.
MatterWave
A lightweight matter-wave wrapper stored by momentum magnitude.
MovingMass
A moving mass with scalar velocity.
NuclideNumbers
Mass and atomic numbers for a nuclide.
Particle
A lightweight particle wrapper that delegates to the free helper functions.
Photon
A lightweight photon wrapper stored by energy in joules.
PipeFlow
A simple cross-sectional pipe flow with area and scalar velocity.
PlasmaSpecies
A simple scalar plasma species description.
PointForce2D
A planar force applied at a position relative to a chosen moment point.
QuantumNumbers
Quantum numbers for a single-electron atomic-state style validation helper.
RadiationBeam
A simple beam characterized by total power and illuminated area.
RelativisticBody
A body with scalar rest mass and signed velocity.
RigidBody1D
A one-dimensional rigid body with scalar translational and rotational state.
RotatingBody
A rotating body with scalar moment of inertia and angular velocity.
Shield
A simple slab shield with a linear attenuation coefficient and thickness.
SimpleHarmonicOscillator
A simple scalar harmonic oscillator state.
Spin
A spin value expressed as doubled units of hbar.
SpringOscillator
A spring-mass oscillator state.
StaticSystem2D
A simple planar static system made of force vectors and scalar moments.
TorqueSystem
A collection of torque values that can be analyzed as a system.

Enums§

DensityError
MotionError
ParticleFamily
Broad family groupings for the supported particles.
ParticleKind
Identifies a supported particle kind.
ParticleStatistics
Spin-statistics classification for the supported particles.
PowerError
PressureError
RadiationKind
Simple radiation categories for scalar helper selection.
ThermodynamicsError

Constants§

ATOMIC_MASS_UNIT_MEV_C2
Atomic mass unit energy equivalent in mega-electron-volts per c^2.
BOHR_RADIUS
Bohr radius a0, in meters.
BOLTZMANN_CONSTANT
Boltzmann constant in joules per kelvin.
COULOMB_CONSTANT
Coulomb’s constant for electrostatic force calculations.
ELECTROMAGNETISM_SPEED_OF_LIGHT
Speed of light in vacuum, in meters per second.
ELECTROMAGNETISM_VACUUM_PERMEABILITY
Vacuum permeability in henries per meter.
ELECTRON_MASS
Electron rest mass, in kilograms.
ELEMENTARY_CHARGE
Elementary charge, in coulombs.
GRAVITATIONAL_CONSTANT
Newtonian constant of gravitation, in cubic meters per kilogram second squared.
IDEAL_GAS_CONSTANT
JOULES_PER_MEV
Joules in one mega-electron-volt.
LN_2
Natural logarithm of 2 for half-life conversions and decay-law helpers.
PLANCK_CONSTANT
Planck constant h, in joule seconds.
PLASMA_ELECTRON_MASS
Electron mass in kilograms.
PLASMA_ELEMENTARY_CHARGE
Elementary charge in coulombs.
PLASMA_VACUUM_PERMEABILITY
Vacuum permeability in henries per meter.
PLASMA_VACUUM_PERMITTIVITY
Vacuum permittivity in farads per meter.
PROTON_MASS
Proton mass in kilograms.
QUANTUM_SPEED_OF_LIGHT
Speed of light in vacuum, in meters per second.
RADIATION_JOULES_PER_MEV
Joules in one mega-electron-volt.
RADIATION_SPEED_OF_LIGHT
Speed of light in vacuum, in meters per second.
REDUCED_PLANCK_CONSTANT
Reduced Planck constant hbar, in joule seconds.
RELATIVITY_SPEED_OF_LIGHT
Speed of light in vacuum, in meters per second.
RYDBERG_ENERGY_EV
Hydrogen Rydberg energy magnitude, in electron volts.
SPEED_OF_LIGHT
Speed of light in vacuum in meters per second.
STANDARD_GRAVITY
VACUUM_PERMEABILITY
Vacuum permeability in newtons per ampere squared.
VACUUM_PERMITTIVITY
Vacuum permittivity in farads per meter.

Functions§

absolute_pressure
Computes absolute pressure from surface pressure and the hydrostatic contribution.
absorbed_dose
Computes absorbed dose with D = E / m.
absorbed_energy_from_dose
Computes absorbed energy from dose with E = D * m.
acceleration
Computes acceleration for simple harmonic motion using a(t) = -Aω² * cos(ωt + φ).
acceleration_from_displacement
Computes simple-harmonic acceleration from displacement using a = -ω²x.
accumulated_dose
Computes accumulated dose with D = dose_rate * t.
activity
Computes activity from a decay constant and number of nuclei.
alfven_speed
Computes the Alfven speed.
altitude_from_orbital_radius
Computes altitude from body radius and orbital radius.
angular_acceleration
Computes angular acceleration using α = (ω_final - ω_initial) / t.
angular_acceleration_from_torque
Computes angular acceleration from torque and moment of inertia.
angular_displacement
Computes angular displacement using θ = ω_initial * t + 0.5 * α * t².
angular_frequency_from_energy
Computes angular frequency from energy using omega = E / hbar.
angular_frequency_from_frequency
Computes angular frequency from frequency using ω = 2πf.
angular_frequency_from_period
Computes angular frequency from period using ω = 2π / T.
angular_impulse_from_angular_velocity_change
Computes angular impulse from an angular velocity change using J = I(ω_final - ω_initial).
angular_momentum
Computes angular momentum using L = Iω.
angular_velocity
Computes angular velocity using ω = Δθ / t.
angular_velocity_after_angular_impulse
Computes final angular velocity after an angular impulse using ω_final = ω_initial + J / I.
angular_velocity_from_angular_momentum
Computes angular velocity from angular momentum using ω = L / I.
angular_velocity_from_rotational_kinetic_energy
Computes angular velocity from rotational kinetic energy using ω = sqrt(2KE / I).
angular_velocity_from_tangential_speed
Computes angular velocity from tangential speed using ω = v / r.
antiparticle
Returns the modeled antiparticle for kind.
apoapsis_from_semi_major_axis_eccentricity
Computes apoapsis radius from semi-major axis and eccentricity.
apoapsis_speed
Computes speed at apoapsis using the vis-viva equation.
attenuated_intensity
Computes attenuated intensity with I = I0 * e^(-mu * x).
average_force_from_impulse
Computes average force from impulse and elapsed time using F = J / Δt.
average_power
Computes average power from total work and elapsed duration.
average_speed
Computes average speed from traveled distance and elapsed duration.
axial_deformation
Computes axial deformation of a prismatic bar under linear elastic loading.
axial_stiffness
Computes axial stiffness of a uniform elastic bar.
balancing_force
Computes the balancing force needed at a lever arm to cancel a known torque.
balancing_lever_arm
Computes the balancing lever arm needed for a force to cancel a known torque.
bernoulli_pressure
Computes downstream pressure from the Bernoulli relation between two points.
beta
Computes the dimensionless speed ratio β = v / c.
beta_from_rapidity
Computes β = tanh(φ) from rapidity.
binding_energy_mev_from_mass_defect_u
Computes binding energy in mega-electron-volts from a mass defect in atomic mass units.
binding_energy_per_nucleon
Computes binding energy per nucleon.
bohr_orbit_radius
Computes the hydrogen-like Bohr orbit radius for Z = 1 using r_n = a0 * n^2.
bulk_modulus
Computes bulk modulus from pressure change and volumetric strain.
bulk_modulus_from_youngs_and_poisson
Computes bulk modulus from Young’s modulus and Poisson’s ratio.
buoyant_force
Computes buoyant force from fluid density, displaced volume, and gravitational acceleration.
can_static_friction_hold
Checks whether static friction can hold a body at rest.
cantilever_end_point_load_reaction
Computes the fixed-end reaction for a cantilever with a downward load at the free end.
celsius_to_kelvin
center_moment_from_parallel_axis
Computes the center moment from a shifted moment using I_cm = I - md².
center_of_mass_1d
Computes the one-dimensional center of mass using x_cm = Σ(m_i * x_i) / Σm_i.
centripetal_acceleration_from_angular_velocity
Computes centripetal acceleration using a_c = ω²r.
centripetal_acceleration_from_tangential_speed
Computes centripetal acceleration using a_c = v² / r.
change_in_length
Computes change in length from strain and original length.
change_in_volume
Computes change in volume from volumetric strain and original volume.
charge
Returns the exact charge for kind.
charge_density
Computes charge density.
charge_from_current_time
Computes electric charge from current and elapsed time.
charge_in_elementary_units
Returns the charge in elementary-charge units.
charge_thirds
Returns the exact charge in thirds of the elementary charge.
circular_orbital_period
Computes the orbital period for a circular orbit.
circular_orbital_speed
Computes the speed for a circular orbit at a radius around a body with gravitational parameter.
circular_orbital_velocity
Computes the circular orbital velocity around a source mass.
coefficient_of_restitution
Computes the coefficient of restitution from approach and separation speeds.
collision_energy_loss_1d
Computes the total kinetic energy lost in a one-dimensional collision.
collision_energy_loss_fraction_1d
Computes the fraction of kinetic energy lost in a one-dimensional collision.
collision_final_velocities_1d
Computes the final velocities of a one-dimensional collision from masses, initial velocities, and a coefficient of restitution.
collision_impulse_on_a
Computes the collision impulse applied to body A.
collision_impulse_on_b
Computes the collision impulse applied to body B.
collision_impulses_1d
Computes the impulses on both bodies for a one-dimensional collision.
collision_kinetic_energy
Computes kinetic energy from mass and one-dimensional velocity.
combined_mass
Computes the sum of non-negative masses.
conductance
Computes conductance from resistance.
continuity_area
Computes downstream area from continuity for incompressible flow.
continuity_velocity
Computes downstream velocity from continuity for incompressible flow.
contracted_length
Computes contracted length L = L0 / γ from proper length L0.
coulomb_force
Computes electrostatic force using Coulomb’s law.
critical_damping_coefficient
Computes the critical damping coefficient using c_critical = 2 * sqrt(mk).
current
Computes current from voltage and resistance using Ohm’s law.
current_from_charge_time
Computes current from electric charge and elapsed time.
cyclotron_angular_frequency
Computes cyclotron angular frequency using ω = |q|B / m.
cyclotron_frequency
Computes cyclotron frequency in cycles per second using f = |q|B / (2πm).
cyclotron_radius
Computes cyclotron radius using r = mv / (|q|B).
damped_angular_frequency
Computes the damped angular frequency for an underdamped oscillator.
damping_ratio
Computes damping ratio using ζ = c / (2 * sqrt(mk)).
damping_ratio_from_quality_factor
Computes damping ratio from quality factor using ζ = 1 / (2Q).
de_broglie_wavelength
Computes de Broglie wavelength from momentum magnitude using lambda = h / p.
de_broglie_wavelength_from_mass_velocity
Computes de Broglie wavelength from mass and velocity using lambda = h / (m * |v|).
debye_length
Computes the Debye length.
debye_number
Computes the Debye number.
debye_sphere_volume
Computes the Debye sphere volume.
decay_constant_from_half_life
Computes a decay constant from a half-life.
decayed_fraction_from_decay_constant
Computes the decayed fraction from a decay constant and elapsed time.
decayed_quantity_from_decay_constant
Computes the decayed quantity from an initial quantity, decay constant, and elapsed time.
default_radiation_weighting_factor
Returns a simple conventional radiation weighting factor for the given kind.
degrees_from_radians
Converts radians to degrees.
density_of
Computes density from mass and occupied volume.
dilated_time
Computes dilated coordinate time t = γτ from proper time τ.
displaced_volume_from_buoyant_force
Computes displaced volume from buoyant force, fluid density, and gravitational acceleration.
displacement
displacement_from_work
Computes the displacement implied by a work value and a constant force.
distance
doppler_factor_longitudinal_from_beta
Computes the longitudinal relativistic Doppler factor D = sqrt((1 + β) / (1 - β)).
dose_rate
Computes dose rate with dose_rate = D / t.
downslope_force_incline
Computes the downslope component of weight on an incline.
drag_force
Computes drag force from density, velocity, drag coefficient, and area.
dynamic_pressure
Computes dynamic pressure from density and flow velocity.
dynamic_viscosity
Computes dynamic viscosity from kinematic viscosity and density.
earth_weight
eccentricity_from_apsides
Computes eccentricity from periapsis and apoapsis radii.
effective_dose
Computes effective dose with E = H * w_T.
elapsed_time_from_remaining_fraction
Computes elapsed time from a remaining fraction and decay constant.
elastic_collision_final_velocities_1d
Computes the final velocities of a perfectly elastic one-dimensional collision.
elastic_energy_density
Computes elastic strain-energy density.
elastic_energy_from_force_deformation
Computes elastic energy from force and deformation for a linear loading path.
elastic_energy_from_spring_constant
Computes elastic energy stored in a linear spring from stiffness and deformation.
electric_field_energy_density
Computes electric field energy density using u_E = 0.5 * ε0 * E².
electric_field_for_velocity_selector
Computes electric field magnitude for a selector using E = vB.
electric_field_from_magnetic_flux_density_in_vacuum
Computes electric field magnitude in vacuum using E = cB.
electric_force_on_charge
Computes electric force using F = qE.
electrical_power
electromagnetic_energy_density
Computes combined electromagnetic energy density.
electron_gyrofrequency
Computes the electron gyrofrequency using electron mass and charge magnitude.
electron_gyroradius
Computes the electron gyroradius using electron mass and charge magnitude.
electron_plasma_angular_frequency
Computes the electron plasma angular frequency.
electron_plasma_frequency
Computes the electron plasma frequency in hertz.
electron_thermal_speed
Computes the electron thermal speed.
electron_volts_to_joules
Converts electron volts to joules using J = eV * e.
elliptical_orbital_period
Computes the orbital period for an elliptical orbit.
energy_fluence
Computes energy fluence with Psi = E / A.
energy_from_angular_frequency
Computes energy from angular frequency using E = hbar * omega.
energy_from_mass_defect_kg
Computes energy in joules from a mass defect in kilograms.
energy_from_power_time
Computes electrical energy from power and elapsed time.
energy_from_voltage_charge
Computes electrical energy from voltage and charge.
energy_momentum_relation
Computes total energy from rest mass and momentum using E = sqrt((pc)² + (mc²)²).
equivalent_dose
Computes equivalent dose with H = D * w_R.
escape_speed
Computes escape speed from a distance around a body with gravitational parameter.
escape_velocity
Computes the escape velocity from a source mass at a distance.
family
Returns the broad particle family for kind.
final_angular_velocity
Computes final angular velocity using ω_final = ω_initial + αt.
final_angular_velocity_from_displacement
Computes final angular velocity using ω_final = sqrt(ω_initial² + 2αθ).
final_angular_velocity_squared
Computes squared final angular velocity using ω_final² = ω_initial² + 2αθ.
final_kinetic_energy_from_work
Computes final kinetic energy from an initial kinetic energy and applied work.
final_length
Computes final length after elastic axial strain.
final_velocity
fluence
Computes fluence with F = N / A.
fluence_rate
Computes fluence rate with fluence_rate = F / t.
fluid_hydrostatic_pressure
Computes hydrostatic pressure from fluid density, gravitational acceleration, and depth.
force
force_angle_radians
Computes the planar angle of a force vector in radians.
force_from_axial_deformation
Computes force from axial deformation of a uniform elastic bar.
force_from_stress
Computes force from stress and cross-sectional area.
force_from_torque
Computes the force required to produce a known torque at a lever arm.
force_from_work
Computes the force required to perform a given amount of work over a displacement.
force_magnitude
Computes the magnitude of a planar force vector.
frequency_from_angular_frequency
Computes frequency from angular frequency using f = ω / 2π.
frequency_from_period
Computes frequency from period using f = 1 / T.
frequency_from_photon_energy
Computes frequency from photon energy using f = E / h.
gauge_pressure
gravitational_acceleration
Computes the gravitational acceleration caused by a source mass at a distance.
gravitational_force
Computes the gravitational attraction between two point masses.
gravitational_parameter
Computes the standard gravitational parameter from a source mass.
gravitational_potential_energy
Computes gravitational potential energy between two masses.
gravity_weight
Computes weight from mass and gravitational acceleration.
gyro_angular_frequency
Computes the gyro angular frequency.
gyrofrequency
Computes the gyrofrequency in hertz.
gyroradius
Computes the gyroradius.
half_life_from_decay_constant
Computes a half-life from a decay constant.
half_value_layer
Computes half-value layer with HVL = ln(2) / mu.
has_rest_mass
Returns whether kind has nonzero rest mass when that metadata is modeled here.
heat_energy
hohmann_delta_v_1
Computes the first burn for a Hohmann transfer.
hohmann_delta_v_2
Computes the second burn for a Hohmann transfer.
hohmann_total_delta_v
Computes the total scalar delta-v magnitude for a Hohmann transfer.
hohmann_transfer_semi_major_axis
Computes the semi-major axis of a Hohmann transfer ellipse.
hohmann_transfer_time
Computes the transfer time for a Hohmann transfer.
hollow_sphere_moment_of_inertia
Computes hollow-sphere moment of inertia using I = (2 / 3)mr².
hydrogen_energy_level_ev
Computes the hydrogen energy level in electron volts using E_n = -Ry / n^2.
hydrogen_transition_energy_ev
Computes the absolute transition energy between two hydrogen energy levels in electron volts.
hydrogen_transition_wavelength
Computes the photon wavelength for a hydrogen transition in meters.
hydrostatic_pressure
ideal_gas_pressure
Computes ideal gas pressure from amount of substance, temperature, and volume.
impulse
impulse_from_momentum_change
Computes impulse from a change in momentum using J = p_final - p_initial.
impulse_from_velocity_change
Computes impulse from a velocity change using J = m(v_final - v_initial).
initial_kinetic_energy_from_work
Computes initial kinetic energy from a final kinetic energy and applied work.
intensity
Computes intensity from power and area with I = P / A.
inverse_square_intensity
Computes inverse-square intensity from a reference value.
ion_plasma_angular_frequency
Computes the ion plasma angular frequency.
is_antiparticle
Returns true when kind is represented as an antiparticle variant.
is_baryon
Returns true when kind is a baryon.
is_boson
Returns true when kind is a boson.
is_common_poisson_ratio
Returns true when Poisson’s ratio is finite and between 0.0 and 0.5, inclusive.
is_critically_damped
Returns true when the damping ratio is within tolerance of critical damping.
is_fermion
Returns true when kind is a fermion.
is_ionizing
Returns whether the listed radiation kind is ionizing in this simple crate.
is_lepton
Returns true when kind is a lepton.
is_meson
Returns true when kind is a meson.
is_overdamped
Returns true when the damping ratio represents an overdamped system.
is_particle_radiation
Returns whether the listed radiation kind is particle radiation.
is_perfectly_elastic
Returns whether a valid restitution coefficient is effectively perfectly elastic.
is_perfectly_inelastic
Returns whether a valid restitution coefficient is effectively perfectly inelastic.
is_photon_radiation
Returns whether the listed radiation kind is photon radiation.
is_quark
Returns true when kind is a quark.
is_quasi_neutral
Checks whether a plasma is quasi-neutral within a relative tolerance.
is_rotational_equilibrium
Checks whether a torque system is in rotational equilibrium.
is_self_antiparticle
Returns true when kind is its own antiparticle.
is_static_equilibrium_2d
Checks whether a planar static system satisfies both translational and rotational equilibrium.
is_subluminal_speed
Returns true when speed is finite, non-negative, and strictly less than the speed of light.
is_translational_equilibrium_1d
Checks whether a 1D force system is in translational equilibrium.
is_translational_equilibrium_2d
Checks whether a 2D force system is in translational equilibrium.
is_underdamped
Returns true when the damping ratio represents an underdamped system.
is_valid_azimuthal_quantum_number
Returns true when n >= 1 and l < n.
is_valid_coulomb_logarithm
Returns whether a Coulomb logarithm value is finite and positive.
is_valid_magnetic_quantum_number
Returns true when -l <= m_l <= l.
is_valid_nuclide_numbers
Validates mass and atomic numbers for a simple nuclide representation.
is_valid_principal_quantum_number
Returns true when n >= 1.
is_valid_quantum_numbers
Returns true when the supplied quantum-number combination is valid.
is_valid_restitution
Returns true when a restitution coefficient is finite and within [0.0, 1.0].
is_valid_spin_twice
Returns true when the spin projection is one of -1 or 1.
isotropic_intensity
Computes isotropic intensity from power and distance with I = P / (4 * pi * r^2).
joules_to_electron_volts
Converts joules to electron volts using eV = J / e.
joules_to_mev
Converts energy in joules to mega-electron-volts.
kinematic_viscosity
Computes kinematic viscosity from dynamic viscosity and density.
kinetic_energy
kinetic_energy_from_total_and_potential
Computes kinetic energy from total energy and potential energy using KE = E_total - U.
kinetic_energy_loss
Computes the kinetic energy lost between an initial and final state.
kinetic_energy_loss_fraction
Computes the fraction of kinetic energy lost between two states.
lever_arm_from_torque
Computes the lever arm required to produce a known torque from a force.
linear_attenuation_from_mass_attenuation
Computes linear attenuation coefficient from mass attenuation and density.
linear_kinetic_energy
Computes translational kinetic energy using KE = 0.5mv².
linear_momentum
Computes linear momentum using p = mv.
lorentz_factor
Computes the Lorentz factor γ from a speed magnitude in meters per second.
lorentz_factor_from_beta
Computes the Lorentz factor γ = 1 / sqrt(1 - β²) from a non-negative beta magnitude.
lorentz_force_magnitude_perpendicular
Computes |F| = |q| * |E + vB| for perpendicular fields along the same scalar direction.
lorentz_force_scalar
Computes the scalar Lorentz-force convenience relation F = q(E + vB sin(theta)).
lorentz_force_scalar_degrees
Computes the scalar Lorentz-force convenience relation with the angle in degrees.
magnetic_energy_density
Computes magnetic energy density.
magnetic_field_around_long_straight_wire
Computes magnetic flux density around a long straight wire.
magnetic_field_at_center_of_loop
Computes magnetic flux density at the center of a circular current loop.
magnetic_field_energy_density
Computes magnetic field energy density using u_B = B² / (2μ0).
magnetic_field_inside_solenoid
Computes magnetic flux density inside an ideal long solenoid.
magnetic_flux
Computes magnetic flux through an area.
magnetic_flux_degrees
Computes magnetic flux through an area using an angle in degrees.
magnetic_flux_density_for_velocity_selector
Computes magnetic flux density magnitude for a selector using B = E / v.
magnetic_flux_density_from_electric_field_in_vacuum
Computes magnetic flux density magnitude in vacuum using B = E / c.
magnetic_flux_density_from_flux
Computes magnetic flux density from magnetic flux, area, and orientation.
magnetic_force_magnitude_on_charge
Computes the magnitude of magnetic force on a moving charge.
magnetic_force_on_charge
Computes magnetic force on a moving charge.
magnetic_force_on_charge_degrees
Computes magnetic force on a moving charge using an angle in degrees.
magnetic_force_on_moving_charge
Computes magnetic force using F = qvB sin(theta).
magnetic_force_on_moving_charge_degrees
Computes magnetic force using F = qvB sin(theta) with the angle in degrees.
magnetic_force_on_wire
Computes magnetic force on a current-carrying wire.
magnetic_force_on_wire_degrees
Computes magnetic force on a current-carrying wire using an angle in degrees.
magnetic_pressure
Computes magnetic pressure.
mass_attenuation_from_linear_attenuation
Computes mass attenuation coefficient from linear attenuation and density.
mass_defect_kg_from_energy
Computes mass defect in kilograms from energy in joules.
mass_flow_rate
Computes mass flow rate from density and volumetric flow rate.
mass_from_density
mass_from_momentum
Computes mass from momentum and velocity using m = p / v.
mass_from_rest_energy
Computes rest mass m = E0 / c² from rest energy in joules.
mass_from_spring_period
Computes mass from spring constant and period using m = kT² / 4π².
max_acceleration
Computes the maximum acceleration using a_max = Aω².
max_speed
Computes the maximum speed using v_max = Aω.
maximum_static_friction
Computes the maximum available static friction.
mean_lifetime
Computes the mean lifetime from a decay constant.
mechanical_power
mev_to_joules
Converts energy in mega-electron-volts to joules.
minimum_energy_uncertainty
Computes the minimum energy uncertainty estimate from delta E >= hbar / (2 * delta t).
minimum_momentum_uncertainty
Computes the minimum momentum uncertainty estimate from delta p >= hbar / (2 * delta x).
minimum_position_uncertainty
Computes the minimum position uncertainty estimate from delta x >= hbar / (2 * delta p).
minimum_static_friction_coefficient_for_incline
Computes the minimum static friction coefficient needed to prevent sliding on an incline.
minimum_time_uncertainty
Computes the minimum time uncertainty estimate from delta t >= hbar / (2 * delta E).
moment_2d
Computes the scalar z-moment of a planar force about a chosen point.
moment_arm
Computes the perpendicular moment arm from a lever arm and angle in radians.
moment_arm_degrees
Computes the perpendicular moment arm from an angle given in degrees.
moment_from_force_and_arm
Computes a moment from a signed force and a signed moment arm.
momentum
Computes linear momentum using p = m * v.
momentum_from_de_broglie_wavelength
Computes momentum magnitude from a de Broglie wavelength using p = h / lambda.
momentum_impulse
Computes impulse from force and elapsed time using J = F * Δt.
near_surface_potential_energy
Computes near-surface potential energy from mass, height, and gravitational acceleration.
net_force_1d
Computes the net force from a list of scalar forces.
net_force_2d
Computes the net force from a list of planar force components.
net_moment
Computes the net moment from a slice of scalar moment values.
net_moment_2d
Computes the net moment from planar point forces.
net_torque
Computes the sum of a slice of torque values.
net_torque_from_force_lever_pairs
Computes the net torque for force and lever-arm pairs.
net_work
Computes the net work from a slice of work contributions.
neutron_count
Computes neutron count from mass number and atomic number.
normal_force_horizontal_surface
Computes the normal force on a horizontal surface.
normal_force_incline
Computes the normal force on an incline.
normal_strain
Computes normal strain from change in length and original length.
normal_stress
Computes normal stress from applied force and cross-sectional area.
nuclei_from_activity
Computes the number of nuclei from activity and decay constant.
nucleon_count
Computes nucleon count from proton and neutron counts.
observed_frequency_longitudinal
Computes observed longitudinal Doppler-shifted frequency f_observed = f_emitted * D.
orbital_radius_from_altitude
Computes orbital radius from body radius and altitude.
orbital_radius_from_circular_speed
Computes the circular orbital radius from circular speed.
orbital_radius_from_period
Computes the circular orbital radius from an orbital period.
oscillation_displacement
Computes displacement for simple harmonic motion using x(t) = A * cos(ωt + φ).
oscillation_spring_potential_energy
Computes spring potential energy using U = 0.5 * k * x².
oscillator_total_energy
Computes oscillator total energy using E = 0.5 * k * A².
parallel_axis_moment_of_inertia
Applies the parallel-axis theorem using I = I_cm + md².
parallel_resistance
Computes the total resistance for resistors in parallel.
particle_thermal_speed
Computes a particle thermal speed.
pendulum_length_from_period
Computes pendulum length from period using L = g * (T / 2π)².
perfectly_inelastic_collision_final_velocities_1d
Computes the final velocities of a perfectly inelastic one-dimensional collision.
perfectly_inelastic_collision_velocity_1d
Computes the shared final velocity of a perfectly inelastic one-dimensional collision.
periapsis_from_semi_major_axis_eccentricity
Computes periapsis radius from semi-major axis and eccentricity.
periapsis_speed
Computes speed at periapsis using the vis-viva equation.
period_from_angular_frequency
Computes period from angular frequency using T = 2π / ω.
period_from_frequency
Computes period from frequency using T = 1 / f.
perpendicular_force_component
Computes the component of a force that acts perpendicular to a lever arm.
perpendicular_force_component_degrees
Computes the perpendicular force component from an angle given in degrees.
photon_energy_from_frequency
Computes photon energy from frequency using E = h * f.
photon_energy_from_wavelength
Computes photon energy from wavelength using E = h * c / lambda.
photon_flux_density
Computes photon flux density with phi = Phi / A.
photon_flux_from_power
Computes photon flux from power with Phi = P / E_photon.
photon_momentum_from_energy
Computes photon momentum from energy using p = E / c.
photon_momentum_from_wavelength
Computes photon momentum from wavelength using p = h / lambda.
plasma_beta
Computes plasma beta.
plasma_magnetic_pressure
Computes magnetic pressure.
plasma_pressure
Computes scalar plasma pressure.
point_mass_moment_of_inertia
Computes the moment of inertia for a point mass.
poisson_ratio
Computes Poisson’s ratio from transverse and axial strain.
potential_energy
power_from_current_resistance
Computes electrical power from current and resistance.
power_from_voltage_current
Computes electrical power from voltage and current.
power_from_voltage_resistance
Computes electrical power from voltage and resistance.
poynting_magnitude
Computes Poynting magnitude in vacuum using S = EB / μ0.
pressure
Computes pressure from applied force and cross-sectional area.
pressure_change_from_bulk_modulus
Computes pressure change from bulk modulus and volumetric strain.
proper_length
Computes proper length L0 = Lγ from a contracted length L.
proper_time
Computes proper time τ = t / γ from dilated coordinate time t.
quality_factor_from_damping_ratio
Computes quality factor from damping ratio using Q = 1 / (2ζ).
radians_from_degrees
Converts degrees to radians.
radians_from_revolutions
Converts revolutions to radians.
rapidity_from_beta
Computes rapidity φ = atanh(β) from a signed beta.
recoil_velocity
Computes recoil velocity assuming the initial total momentum is zero.
reduced_mass
Computes reduced mass using μ = (m1 * m2) / (m1 + m2).
relative_speed
Computes the relative speed between two one-dimensional bodies.
relative_velocity
Computes the signed relative velocity between two one-dimensional bodies.
relativistic_kinetic_energy
Computes relativistic kinetic energy KE = (γ - 1)mc² in joules.
relativistic_momentum
Computes relativistic momentum p = γmv.
remaining_fraction_from_decay_constant
Computes the remaining fraction from a decay constant and elapsed time.
remaining_fraction_from_half_life
Computes the remaining fraction from a half-life and elapsed time.
remaining_quantity_from_decay_constant
Computes the remaining quantity from an initial quantity, decay constant, and elapsed time.
remaining_quantity_from_half_life
Computes the remaining quantity from an initial quantity, half-life, and elapsed time.
required_shield_thickness
Computes required shield thickness with x = ln(I0 / I) / mu.
required_static_friction
Computes the static friction magnitude required to hold horizontal equilibrium.
resistance
Computes resistance from voltage and current using Ohm’s law.
resistance_from_conductance
Computes resistance from conductance.
resonance_angular_frequency_natural
Computes the natural resonance angular frequency of a spring-mass oscillator.
rest_energy
Computes rest energy E0 = mc² in joules.
rest_mass_from_momentum_speed
Computes rest mass from relativistic momentum and velocity using m = p / (γv).
rest_mass_mev_c2
Returns an approximate rest mass in MeV/c^2 for kind.
revolutions_from_radians
Converts radians to revolutions.
reynolds_number
Computes Reynolds number from density, velocity, characteristic length, and dynamic viscosity.
rigidbody_angular_momentum
Computes angular momentum using L = Iω.
rigidbody_hollow_sphere_moment_of_inertia
Computes hollow-sphere moment of inertia using I = (2 / 3)mr².
rigidbody_point_mass_moment_of_inertia
Computes point-mass moment of inertia using I = mr².
rigidbody_rod_moment_of_inertia_about_center
Computes rod moment of inertia about its center using I = (1 / 12)mL².
rigidbody_rod_moment_of_inertia_about_end
Computes rod moment of inertia about one end using I = (1 / 3)mL².
rigidbody_rotational_kinetic_energy
Computes rotational kinetic energy using KE_rot = 0.5Iω².
rigidbody_solid_disk_moment_of_inertia
Computes solid-disk moment of inertia using I = 0.5mr².
rigidbody_solid_sphere_moment_of_inertia
Computes solid-sphere moment of inertia using I = (2 / 5)mr².
rigidbody_thin_ring_moment_of_inertia
Computes thin-ring moment of inertia using I = mr².
rod_moment_of_inertia_about_center
Computes the moment of inertia of a uniform rod about its center.
rod_moment_of_inertia_about_end
Computes the moment of inertia of a uniform rod about one end.
rotation_angular_acceleration_from_torque
Computes angular acceleration from torque using α = τ / I.
rotation_point_mass_moment_of_inertia
Computes point-mass moment of inertia using I = mr².
rotation_rod_moment_of_inertia_about_center
Computes rod moment of inertia about its center using I = (1 / 12)mL².
rotation_rod_moment_of_inertia_about_end
Computes rod moment of inertia about one end using I = (1 / 3)mL².
rotational_kinetic_energy
Computes rotational kinetic energy using KE_rot = 0.5 * I * ω².
semi_major_axis_from_apsides
Computes the semi-major axis from periapsis and apoapsis radii.
semi_major_axis_from_specific_energy
Computes the semi-major axis for a bound orbit from specific orbital energy.
separation_speed_from_restitution
Computes separation speed from an approach speed and restitution coefficient.
series_resistance
Computes the total resistance for resistors in series.
shear_modulus
Computes shear modulus from shear stress and shear strain.
shear_modulus_from_youngs_and_poisson
Computes shear modulus from Young’s modulus and Poisson’s ratio.
shear_strain
Computes engineering shear strain from lateral displacement and height.
shear_strain_from_modulus
Computes shear strain from shear stress and shear modulus.
shear_stress
Computes shear stress from applied force and loaded area.
shear_stress_from_modulus
Computes shear stress from shear modulus and shear strain.
simple_pendulum_angular_frequency
Computes small-angle simple pendulum angular frequency using ω = sqrt(g / L).
simple_pendulum_frequency
Computes small-angle simple pendulum frequency in cycles per second.
simple_pendulum_period
Computes the small-angle simple pendulum period using T = 2π * sqrt(L / g).
simply_supported_point_load_reactions
Computes support reactions for a simply supported beam with one point load.
simply_supported_uniform_load_reactions
Computes support reactions for a simply supported beam with a uniform load.
solid_disk_moment_of_inertia
Computes solid-disk moment of inertia using I = 0.5mr².
solid_sphere_moment_of_inertia
Computes solid-sphere moment of inertia using I = (2 / 5)mr².
source_mass_from_gravitational_parameter
Computes the source mass from a standard gravitational parameter.
specific_activity
Computes specific activity from activity and mass.
specific_orbital_energy
Computes specific orbital energy.
speed_from_beta
Computes the speed magnitude v = βc in meters per second.
speed_from_permittivity_permeability
Computes propagation speed from permittivity and permeability using v = 1 / sqrt(εμ).
speed_from_rapidity
Computes signed velocity v = c * tanh(φ) from rapidity.
spin
Returns the spin for kind.
spring_angular_frequency
Computes spring angular frequency using ω = sqrt(k / m).
spring_constant_from_period
Computes spring constant from mass and period using k = 4π²m / T².
spring_frequency
Computes spring frequency in cycles per second.
spring_period
Computes spring period using T = 2π * sqrt(m / k).
spring_potential_energy
Computes the spring potential energy stored at a displacement.
spring_work
Computes work done by an ideal spring force over a displacement interval.
standard_weight
Computes weight under conventional standard gravity.
statics_is_rotational_equilibrium
Checks whether a moment system is in rotational equilibrium.
statistics
Returns the particle statistics implied by the modeled spin.
strain_from_youngs_modulus
Computes strain from stress and Young’s modulus.
stress_from_youngs_modulus
Computes stress from Young’s modulus and axial strain.
tangential_acceleration
Computes tangential acceleration using a_t = αr.
tangential_speed
Computes tangential speed using v = ωr.
tenth_value_layer
Computes tenth-value layer with TVL = ln(10) / mu.
thin_ring_moment_of_inertia
Computes thin-ring moment of inertia using I = mr².
torque
Computes torque from a force and lever arm.
torque_at_angle
Computes torque when the applied force meets the lever arm at an angle in radians.
torque_at_angle_degrees
Computes torque when the applied force meets the lever arm at an angle in degrees.
torques_from_force_lever_pairs
Converts force and lever-arm pairs into torque values.
total_effective_dose
Sums pre-weighted equivalent doses into a total effective dose.
total_energy
Computes total relativistic energy E = γmc² in joules.
total_kinetic_energy
Computes total kinetic energy using KE_total = 0.5mv² + 0.5Iω².
total_kinetic_energy_1d
Computes the total kinetic energy of two one-dimensional bodies.
total_momentum
Computes the total momentum of a slice of momentum values.
total_plasma_pressure
Computes total scalar plasma pressure.
transmitted_fraction
Computes transmitted fraction with T = e^(-mu * x).
transverse_strain_from_poisson_ratio
Computes transverse strain from Poisson’s ratio and axial strain.
two_body_total_momentum
Computes the total momentum of two moving bodies using p_total = m1v1 + m2v2.
velocity
Computes velocity for simple harmonic motion using v(t) = -Aω * sin(ωt + φ).
velocity_addition
Computes relativistic velocity addition u = (v + w) / (1 + vw / c²).
velocity_after_impulse
Computes final velocity after an impulse using v_final = v_initial + J / m.
velocity_from_flow_rate
Computes velocity from volumetric flow rate and area.
velocity_from_momentum
Computes velocity from momentum and mass using v = p / m.
velocity_selector_speed
Computes selector speed using v = E / B.
vis_viva_speed
Computes orbital speed from the vis-viva equation.
voltage
Computes voltage from current and resistance using Ohm’s law.
volume
Computes occupied volume from mass and density.
volume_strain
Computes volumetric strain from change in volume and original volume.
volumetric_flow_rate
Computes volumetric flow rate from area and flow velocity.
wavelength_from_photon_energy
Computes wavelength from photon energy using lambda = h * c / E.
weight
work
work_against_gravity
Computes work done against gravity near a surface.
work_at_angle
Computes mechanical work when the force is applied at an angle to the displacement.
work_at_angle_degrees
Computes mechanical work when the applied-force angle is given in degrees.
work_by_friction
Computes work done by kinetic friction.
work_by_gravity
Computes work done by gravity near a surface.
work_from_force_samples
Approximates work from aligned force and displacement samples.
work_from_kinetic_energy_change
Computes net work from the change in kinetic energy.
youngs_modulus
Computes Young’s modulus from stress and strain.
youngs_modulus_from_shear_and_poisson
Computes Young’s modulus from shear modulus and Poisson’s ratio.