JNISpice
version 2.0.0

spice.basic
Class Units

java.lang.Object
  extended by 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
Units()
           
 
Method Summary
static double convert(double quantity, Units fromUnits, Units toUnits)
          Convert a quantity from one set of units to another.
abstract  java.lang.String toString()
          Return a String representation of a Unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Units

public Units()
Method Detail

toString

public abstract java.lang.String toString()
Return a String representation of a Unit.

Overrides:
toString in class java.lang.Object

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)
   

Throws:
SpiceException

JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)