- java.lang.Object
-
- spice.basic.Units
-
- Direct Known Subclasses:
AngularUnits
,DistanceUnits
public abstract class Units extends java.lang.Object
Class Units represents physical units and supports conversions between them.Version 1.0.0 12-JUL-2009 (NJB)
-
-
Constructor Summary
Constructors Constructor Description Units()
-
-
-
Method Detail
-
toString
public abstract java.lang.String toString()
Return a String representation of a Unit.- Overrides:
toString
in classjava.lang.Object
- Returns:
- toString
-
convert
public static double convert(double quantity, Units fromUnits, Units toUnits) throws SpiceException
Convert a quantity from one set of units to another.The full set of units supported by the underlying conversion algorithm is shown below. However, support for many of these units is not yet implemented in the Alpha version of JNISpice.
Angles: "RADIANS" "DEGREES" "ARCMINUTES" "ARCSECONDS" "HOURANGLE" "MINUTEANGLE" "SECONDANGLE" Metric Distances: "METERS" "KM" "CM" "MM" English Distances: "FEET" "INCHES" "YARDS" "STATUTE_MILES" "NAUTICAL_MILES" Astrometric Distances: "AU" "PARSECS" "LIGHTSECS" "LIGHTYEARS" julian lightyears Time: "SECONDS" "MINUTES" "HOURS" "DAYS" "JULIAN_YEARS" "TROPICAL_YEARS" "YEARS" (same as julian years)
- Parameters:
quantity
- DoublefromUnits
- UnitstoUnits
- Units- Returns:
- Double result
- Throws:
SpiceException
- exception
-
-