unit: add Torque type
MODIFY
unit/constant/defined_types.go
unit/constant/defined_types.go
@@ -40,6 +40,7 @@ var definedTypes = []struct {
{unit: unit.Resistance(1), name: "unit.Resistance"},
{unit: unit.Temperature(1), name: "unit.Temperature"},
{unit: unit.Time(1), name: "unit.Time"},
+ {unit: unit.Torque(1), name: "unit.Torque"},
{unit: unit.Velocity(1), name: "unit.Velocity"},
{unit: unit.Voltage(1), name: "unit.Voltage"},
{unit: unit.Volume(1), name: "unit.Volume"},

MODIFY
unit/generate_unit.go
unit/generate_unit.go
@@ -480,6 +480,20 @@ var Units = []Unit{
},
ErForm: "Pressurer",
},
+ {
+ Name: "Torque",
+ Receiver: "t",
+ PrintString: "N m",
+ Suffix: "newtonmeter",
+ Singular: "Newtonmeter",
+ TypeComment: "Torque represents a torque in Newton meters",
+ Dimensions: []Dimension{
+ {Name: LengthName, Power: 2},
+ {Name: MassName, Power: 1},
+ {Name: TimeName, Power: -2},
+ },
+ ErForm: "Torquer",
+ },
{
Name: "Velocity",
Receiver: "v",

unit: add Torque type