| JEphem Presentation Ephemeris SkyMap Curve Date search Informatic Library Download Glossary About | |
|
JEphem
Ephemeris trail
Units
|
|
Notations :
arcsec : arc second deg : degree h : hour km : kilometer m : meter rad : radian s : second (for time) au : astronomical unit |
UnitsConstants. So constants to designate units are named :
DISTANCE_UNIT_XXX, (ex : DISTANCE_UNIT_KM)LINEAR_SPEED_UNIT_XXX, ANGULAR_UNIT_XXX and ANGULAR_SPEED_UNIT_XXX.UnitConstants also holds constants to designate unit type (units can be 'angular' units, 'distance' units etc..) :
TYPE_DISTANCETYPE_LINEAR_SPEEDTYPE_ANGULARTYPE_ANGULAR_SPEEDAstroContext.calcBodyCoords(). The notion of unit group was developped to conveniently express particular groups of commonly used units.
int[] units = new int[]{DISTANCE_UNIT_AU, DISTANCE_UNIT_AU, DISTANCE_UNIT_AU};
int[] units = UNITGROUP_AU_AU_AU;
Units' javadoc page for more details.
Body need to store the units used to express their coordinates. This is done with two arrays of 3 integers that can be accessed through Body's methods :
public int[] getPositionUnits()
public int[] getVelocityUnits()
public void setPositionUnits(int[] posUnits)
public void setVelocityUnits(int[] posUnits)
positionUnits and velocityUnits of bodies.sphereToCart() and cartToSphere() in class Body).Ephemeris) which display the coordinates.Units APIUnits provides these methods :
public static double[] convertUnits(double[] coords, int[] units1, int[] units2), to convert coordinates between a set of units to an other. public static String getUnitLabel(int unit), to get the english name of a unit.public static String getUnitLabels(int unitType), to get the english names of all units of a certain type.jephem.astro.tools.Ephemeris don't use the two last methods, because they use labels stored in ressource files.
Units is an abstract class. All its fields and methods are static.
|
|