This commit is contained in:
2025-06-04 18:27:10 +02:00
parent 701e732eb6
commit 1b07a3b6ab
13 changed files with 277 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package quantities.generic;
public class LengthUnit extends Unit<Length> {
public LengthUnit(String name, double baseFactor) {
super(name, baseFactor);
}
public static final LengthUnit METER = new LengthUnit("m", 1);
public static final LengthUnit MILLIMETER = new LengthUnit("mm", 0.001);
public static final LengthUnit KILOMETER = new LengthUnit("km", 1000);
public static final LengthUnit MILE = new LengthUnit("mi", 1609.344);
public static final LengthUnit LIGHTYEAR = new LengthUnit("ly", 9460730472580800.0);
public static final LengthUnit PARSEC = new LengthUnit("pc", 3.0856776e16);
@Override
public Length quantity(double value) {
return new Length(value, this);
}
}