Angle constructor
Class for angle conversions, e.g. if you want to convert 1 radiant in degree:
var angle = Angle(removeTrailingZeros: false);
angle.convert(Unit(ANGLE.radians, value: 1));
print(ANGLE.degree);
Implementation
Angle({this.significantFigures = 10, this.removeTrailingZeros = true, name}) {
size = ANGLE.values.length;
this.name = name ?? PROPERTY.angle;
for (ANGLE val in ANGLE.values) {
unitList.add(Unit(val, symbol: mapSymbols[val]));
}
unitConversion = Node(name: ANGLE.degree, leafNodes: [
Node(
coefficientProduct: 1 / 60,
name: ANGLE.minutes,
),
Node(
coefficientProduct: 1 / 3600,
name: ANGLE.seconds,
),
Node(
coefficientProduct: 57.295779513,
name: ANGLE.radians,
),
]);
}