mirror of
https://github.com/diodeinc/pcb.git
synced 2026-09-14 20:17:19 +08:00
27 lines
649 B
Python
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)
|