cgs property
Returns the value of this quantity in alternative CGS (or centimeter-gram-second) units. MKS (meter-kilogram-second) units are preferred.
Although CGS units were once commonly used and contended for the role of standard units, their use is now discouraged in favor of the adopted standard MKS (or meter-kilogram-second) units.
See get mks
.
Implementation
@override
Number get cgs => snapshot.cgs;
Sets the value of this quantity in alternative CGS (or centimeter-gram-second) units. MKS (meter-kilogram-second) units are preferred.
- Although CGS units were once commonly used and contended for the role of standard units, their use is now discouraged in favor of the adopted standard MKS (or meter-kilogram-second) units.
- Throws an ImmutableQuantityException if this Quantity has been made immutable.
See set mks(double)
.
Implementation
set cgs(Number value) {
if (!mutable) throw ImmutableQuantityException(q: this);
var val = value;
// Adjust for centimeters vs. meters.
final lengthExp = dimensions.getComponentExponent(Dimensions.baseLengthKey);
val /= pow(100.0, lengthExp.toDouble());
// Adjust for grams vs. kilograms.
final massExp = dimensions.getComponentExponent(Dimensions.baseMassKey);
val /= pow(1000.0, massExp.toDouble());
mks = Double(val.toDouble());
}