Files
diodeinc__pcb/lib/std/units.zen
2026-07-10 11:10:46 -04:00

27 lines
649 B
Python

# Mathematical constants
PI = 3.14159265358979323846
# Fundamental physical quantity types.
Mass = builtin.Mass
Length = builtin.Length
Time = builtin.Time
Current = builtin.Current
Temperature = builtin.Temperature
# Derived physical quantity types.
Voltage = Mass * Length * Length / (Current * Time * Time * Time)
Frequency = 1 / Time
Charge = Current * Time
Resistance = Voltage / Current
Impedance = Resistance
Conductance = Current / Voltage
Capacitance = Current * Time / Voltage
MagneticFlux = Voltage * Time
Inductance = MagneticFlux / Current
Power = Voltage * Current
Energy = Power * Time
def unit(spec, type):
return type(spec)