KiCad PCB EDA Suite
Loading...
Searching...
No Matches
common/transline_calculations/units_scales.h
Go to the documentation of this file.
1/*
2 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this package; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef TRANSLINE_CALCULATION_UNITS_SCALES_H
21#define TRANSLINE_CALCULATION_UNITS_SCALES_H
22
23
25{
26constexpr double UNIT_KM = 1e3; // km to meter
27constexpr double UNIT_M = 1; // m to meter
28constexpr double UNIT_CM = 1e-2; // cm to meter
29constexpr double UNIT_MM = 1e-3; // mm to meter
30constexpr double UNIT_MICRON = 1e-6; // um to meter
31constexpr double UNIT_INCH = ( 1e-2 * 2.54 ); // inch to meter
32constexpr double UNIT_MIL = ( 1e-5 * 2.54 ); // mil (or thou) to meter
33constexpr double UNIT_FEET = 0.3048; // feet to meter
34constexpr double UNIT_OZSQFT = ( 34.40 * UNIT_MICRON ); // 1 oz/ft^2 is 34.30 microns nominal, 30.90 minimum
35
36constexpr double UNIT_GHZ = 1e9;
37constexpr double UNIT_MHZ = 1e6;
38constexpr double UNIT_KHZ = 1e3;
39
40constexpr double UNIT_DEGREE = M_PI / 180.0; // degree to radian
41constexpr double UNIT_RADIAN = 1.0; // Radian to radian
42
43constexpr double UNIT_OHM = 1.0; // Ohm to Ohm
44constexpr double UNIT_KOHM = 1e3; // KOhm to Ohm
45
46constexpr double UNIT_OHM_PER_METER = 1.0; // Ohm per meter to Ohm per meter
47constexpr double UNIT_OHM_PER_KILOMETER = 1e-3; // Ohm per kilometer to Ohm per meter
48constexpr double UNIT_OHM_PER_FEET = 3.28084; // Ohm per feet to Ohm per meter
49constexpr double UNIT_OHM_PER_1000FEET = 3.28084e-3; // Ohm per 1000feet to Ohm per meter
50
51constexpr double UNIT_KILOVOLT = 1e-3; // Kilovolt to Volt
52constexpr double UNIT_VOLT = 1.0; // Volt to Volt
53constexpr double UNIT_MILLIVOLT = 1e+3; // Millivolt to Volt
54
55constexpr double UNIT_MEGAWATT = 1e-6; // Kilowatt to Watt
56constexpr double UNIT_KILOWATT = 1e-3; // Kilowatt to Watt
57constexpr double UNIT_WATT = 1.0; // Watt to Watt
58constexpr double UNIT_MILLIWATT = 1e+3; // Milliwatt to Watt
59
60constexpr double UNIT_METER_PER_SECOND = 1.0; // meter per second to meter per second
61constexpr double UNIT_KILOMETER_PER_HOUR = ( 1 / 3.6 ); // km/h to m/s
62constexpr double UNIT_FEET_PER_SECOND = 0.3048; // ft/s to m/s
63constexpr double UNIT_MILES_PER_HOUR = 1609.34; // mi/h to m/s
64
65constexpr double UNIT_SECOND = 1.0; // second to second
66constexpr double UNIT_MSECOND = 1e-3; // millisecond to second
67constexpr double UNIT_USECOND = 1e-6; // microsecond to second
68constexpr double UNIT_NSECOND = 1e-9; // nanosecond to second
69constexpr double UNIT_PSECOND = 1e-12; // picosecond to second
70}; // namespace TRANSLINE_CALCULATIONS
71
72#endif // TRANSLINE_CALCULATION_UNITS_SCALES_H
#define M_PI