1 package org.djunits.unit;
2
3 import org.djunits.quantity.Quantity;
4 import org.djunits.unit.scale.IdentityScale;
5 import org.djunits.unit.si.SIPrefixes;
6 import org.djunits.unit.unitsystem.UnitSystem;
7
8
9
10
11
12
13
14
15
16 public class ForceUnit extends Unit<ForceUnit>
17 {
18
19 private static final long serialVersionUID = 20140607L;
20
21
22 public static final Quantity<ForceUnit> BASE = new Quantity<>("Force", "kgm/s2");
23
24
25 public static final ForceUnit SI =
26 new ForceUnit().build(new Unit.Builder<ForceUnit>().setQuantity(BASE).setId("N").setName("newton")
27 .setUnitSystem(UnitSystem.SI_DERIVED).setSiPrefixes(SIPrefixes.NONE, 1.0).setScale(IdentityScale.SCALE));
28
29
30 public static final ForceUnit NEWTON = SI;
31
32
33 public static final ForceUnit DYNE =
34 SI.deriveLinear(factorMA(MassUnit.GRAM, AccelerationUnit.GAL), "dyn", "dyne", UnitSystem.CGS);
35
36
37 public static final ForceUnit KILOGRAM_FORCE = SI.deriveLinear(
38 factorMA(MassUnit.KILOGRAM, AccelerationUnit.STANDARD_GRAVITY), "kgf", "kilogram-force", UnitSystem.OTHER);
39
40
41 public static final ForceUnit OUNCE_FORCE = SI.deriveLinear(factorMA(MassUnit.OUNCE, AccelerationUnit.STANDARD_GRAVITY),
42 "ozf", "ounce-force", UnitSystem.IMPERIAL);
43
44
45 public static final ForceUnit POUND_FORCE = SI.deriveLinear(factorMA(MassUnit.POUND, AccelerationUnit.STANDARD_GRAVITY),
46 "lbf", "pound-force", UnitSystem.IMPERIAL);
47
48
49 public static final ForceUnit TON_FORCE = SI.deriveLinear(factorMA(MassUnit.TON_SHORT, AccelerationUnit.STANDARD_GRAVITY),
50 "tnf", "ton-force", UnitSystem.IMPERIAL);
51
52
53 public static final ForceUnit STHENE =
54 SI.deriveLinear(factorMA(MassUnit.TON_METRIC, AccelerationUnit.METER_PER_SECOND_2), "sn", "sthene", UnitSystem.MTS);
55
56
57
58
59
60
61
62 private static double factorMA(final MassUnit mass, final AccelerationUnit acceleration)
63 {
64 return mass.getScale().toStandardUnit(1.0) * acceleration.getScale().toStandardUnit(1.0);
65 }
66
67 }