|
JEphem site tig API Build classes |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jephem.astro.Body
An object of this class represents a heavenly body.
A Body
characterized by :
index
, corresponding to a SolarSystemConstants
constant -
accessible via getIndex()
;
x0, x1, x2, v0, v1, v2
, for its position and velocity -
accessible via get/setX0() ... get/setV2(), get/setCoords(), get/setPositionCoords(), get/setVelocityCoords()
;
frame
, the reference frame in which its coordinates are expressed -
accessible via get/setFrame()
;coordinateExpression
, the expression mode of its coordinates (spherical / cartesian) -
accessible via get/setCoordinateExpression()
;positionUnits
and velocityUnits
-
accessible via get/setPositionUnits()
and get/setVelocityUnits()
.ComputationException
which may occur during the
computation of its coordinates.x0 = r
,x1 = q
, belongs to [0, 2p[x2 = j
, belongs to [-p/2, p/2].cartToSphere
) assume that this order is respected.
setFrame
won't internally generate coordinate transformations.
Field Summary |
Fields inherited from interface tig.GeneralConstants |
BLANK, FS, LS, NO_SPECIF, SPACE |
Fields inherited from interface jephem.astro.solarsystem.SolarSystemConstants |
E0_1900, E0_1950, E0_2000, EARTH, JUPITER, KM_PER_AU, MARS, MERCURY, MOON, NB_BODIES, NEPTUNE, PLUTO, SATURN, SIDERAL_RATE, SUN, URANUS, VENUS |
Constructor Summary | |
Body(int index)
Constructor to use in general. |
|
Body(int index,
int frame,
int coordExpr,
int[] posUnits,
int[] velUnits,
double x0,
double x1,
double x2,
double v0,
double v1,
double v2)
Complete constructor. |
Method Summary | |
void |
cartToSphere(boolean velocities)
Transformation of coordinates (positions and velocities), from cartesian to spherical. |
Body |
doClone()
Returns a copy of this body. |
ComputationException |
getComputationException()
Returns a computation exception, if one was thrown while computing the coordinates of this body. |
double |
getCoord(int iCoord)
Returns the coordinate designated by 'iCoord' . |
int |
getCoordinateExpression()
Returns the way body's coordinates are expressed (spherical, cartesian), using SpaceConstants constants for it. |
int |
getFrame()
Returns the reference frame in which the body's coordinates are expressed, using SpaceConstants .FRAME_XXX constants. |
int |
getIndex()
Returns the index of this body, using SolarSystemConstants constants. |
java.lang.String |
getName()
Returns the English name of this body. |
Vector3 |
getPositionCoords()
Returns a vector containing the position coordinates. |
int[] |
getPositionUnits()
Returns the units used to express the positions, using constants of UnitsConstants . |
Vector3 |
getVelocityCoords()
Returns a vector containing the position coordinates. |
int[] |
getVelocityUnits()
Returns the units used to express the velocities, using constants of UnitsConstants . |
void |
setComputationException(ComputationException ce)
To store a computation exception, if one is thrown while computing the coordinates of this body. |
void |
setCoord(int iCoord,
double coord)
Sets a coordinate using an index to designate the coordinate. |
void |
setCoordinateExpression(int coordExpr)
Sets the way body's coordinates are expressed ; use SpaceConstants . |
void |
setFrame(int frame)
Sets the reference frame in which the body's coordinates are expressed ; use SpaceConstants .FRAME_XXX constants. |
void |
setIndex(int index)
Sets the index of this body, using SolarSystemConstants constants. |
void |
setPositionCoords(double x0,
double x1,
double x2)
Sets the position coordinates from 3 doubles . |
void |
setPositionCoords(Vector3 pos)
Sets the position coordinates from a vector. |
void |
setPositionUnits(int[] positionUnits)
Sets the units used to express the positions, using constants of UnitsConstants . |
void |
setVelocityCoords(double x0,
double x1,
double x2)
Sets the velocity coordinates from 3 doubles . |
void |
setVelocityCoords(Vector3 vel)
Sets the velocity coordinates from a vector. |
void |
setVelocityUnits(int[] velocityUnits)
sets the units used to express the velocities, using constants of UnitsConstants . |
void |
sphereToCart(boolean velocities)
Transformation of coordinates (positions and velocities), from spherical to cartesian. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Body(int index)
frame
,
coordinateExpression
, positionUnits
, velocityUnits
are initialized to GeneralConstants.NO_SPECIF
.
index
- index of Body to create, using SolarSystemConstants
constants.public Body(int index, int frame, int coordExpr, int[] posUnits, int[] velUnits, double x0, double x1, double x2, double v0, double v1, double v2)
index
- index of Body to create ; use SolarSystemConstants
constants.frame
- Coordinate system in which body coordinates must be expressed ;
use SpaceConstants
constants.coordExpr
- Way coordinates must be expressed (cartesian, spherical) ;
use SpaceConstants
constants.posUnits
- Units used for the positions (use UnitsConstants
constants).velUnits
- Units used for the velocities (use UnitsConstants
constants).x0
- Value of the first position coordinate.x1
- Value of the second position coordinate.x2
- Value of the third position coordinate.v0
- Value of the first velocity coordinate.v1
- Value of the second velocity coordinate.v2
- Value of the third velocity coordinate.
java.lang.IllegalArgumentException
- if posUnits.lenght
or
velUnits.lenght != 3
.Method Detail |
public void cartToSphere(boolean velocities)
velocities
- Indicates if the velocities should be also transformed.
java.lang.IllegalArgumentException
- If units have not been assigned before trying to transformpublic Body doClone()
public ComputationException getComputationException()
public double getCoord(int iCoord)
iCoord
- : index of coordinate to get (0 : x0, ... , 5 : v2).
SpaceConstants
.COORD_XX constants can
be used to express index.public int getCoordinateExpression()
SpaceConstants
constants for it.
public int getFrame()
SpaceConstants
.FRAME_XXX constants.
public int getIndex()
SolarSystemConstants
constants.
public java.lang.String getName()
SolarSystem.getBodyName(this.getIndex())
public Vector3 getPositionCoords()
public int[] getPositionUnits()
UnitsConstants
.
public Vector3 getVelocityCoords()
public int[] getVelocityUnits()
UnitsConstants
.
public void setComputationException(ComputationException ce)
public void setCoord(int iCoord, double coord)
iCoord
- : index of coordinate to get (0 : x0, ... , 5 : v2).public void setCoordinateExpression(int coordExpr)
SpaceConstants
.SPHERICAL
or
CARTESIAN
constants for it.
public void setFrame(int frame)
SpaceConstants
.FRAME_XXX constants.
public void setIndex(int index)
public void setPositionCoords(double x0, double x1, double x2)
doubles
.
public void setPositionCoords(Vector3 pos)
public void setPositionUnits(int[] positionUnits)
UnitsConstants
.
public void setVelocityCoords(double x0, double x1, double x2)
doubles
.
public void setVelocityCoords(Vector3 vel)
public void setVelocityUnits(int[] velocityUnits)
UnitsConstants
.
public void sphereToCart(boolean velocities) throws AstroException
velocities
- Indicates if the velocities should be also transformed.
java.lang.IllegalArgumentException
- If units have not been assigned before trying to transform
AstroException
public java.lang.String toString()
toString
in class java.lang.Object
|
JEphem site tig API Build classes |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |