Skip to main content

pcb_toolkit/
constants.rs

1//! Physical constants used across calculators.
2//!
3//! Values verified against Saturn PCB Toolkit v8.44 binary (see NOTES.md).
4
5/// Speed of light in vacuum (m/s).
6pub const SPEED_OF_LIGHT_MS: f64 = 299_792_458.0;
7
8/// Speed of light in vacuum (in/ns) — convenience for transmission line calcs.
9/// Exact: 299_792_458 m/s × (1 in / 0.0254 m) × (1 s / 1e9 ns) = 11.80285...
10pub const SPEED_OF_LIGHT_IN_NS: f64 = 11.803;
11
12/// Permeability of free space µ₀ (H/m).
13pub const MU_0: f64 = 1.256_637_061_435_9e-6;
14
15/// Permittivity of free space ε₀ (F/m).
16pub const EPSILON_0: f64 = 8.854_187_817e-12;
17
18/// Copper resistivity at 20°C (Ω·cm).
19pub const COPPER_RESISTIVITY_OHM_CM: f64 = 1.724e-6;
20
21/// Copper temperature coefficient (1/°C).
22pub const COPPER_TEMP_COEFF: f64 = 0.00393;
23
24/// Copper melting point (°C) — used in Onderdonk fusing equation.
25pub const COPPER_MELTING_POINT_C: f64 = 1064.62;
26
27/// 4/π — geometric correction for coaxial/via capacitance.
28pub const FOUR_OVER_PI: f64 = 1.273_239_544_735_162_8;
29
30/// 1 mil in meters.
31pub const MIL_TO_M: f64 = 2.54e-5;
32
33/// 1 inch in centimeters.
34pub const INCH_TO_CM: f64 = 2.54;
35
36/// Kirschning-Jansen dispersion constant a.
37pub const KJ_DISPERSION_A: f64 = 0.457;
38
39/// Kirschning-Jansen dispersion constant b.
40pub const KJ_DISPERSION_B: f64 = 0.67;