|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.science.CoordinatesOffset
public class CoordinatesOffset
The difference between two coordinates in the World Coordinate System. This change is represented by a delta right-ascension and delta declination in degrees.
This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project.
Field Summary | |
---|---|
static int |
NUM_DECIMAL
Number of decimal places to show when displaying as string |
Constructor Summary | |
---|---|
CoordinatesOffset()
Constructs and initializes an offset of 0, 0 degrees. |
|
CoordinatesOffset(CoordinatesOffset co)
Constructs and initializes an offset with the same values as the specified CoordinatesOffset object. |
|
CoordinatesOffset(double ra,
double dec)
Constructs and initializes an offset with the specified values in degrees. |
|
CoordinatesOffset(double ra,
double dec,
java.lang.String units)
Constructs and initializes an offset with the specified values in specified units |
Method Summary | |
---|---|
CoordinatesOffset |
add(CoordinatesOffset delta)
Adds another offset to the offset and returns a new offset which is the sum of the two. |
boolean |
equals(java.lang.Object obj)
Determines whether two offsets are equal. |
double |
getDec()
Returns the declination offset in degrees. |
double |
getDec(java.lang.String units)
Returns the declination offset in specified units |
double |
getRa()
Returns the right-ascension offset in degrees. |
double |
getRa(java.lang.String units)
Returns the right-ascension offset in specified units |
void |
rotate(double angleRad)
Rotates the position angleRad radians about a specified center position (ra, dec). |
void |
set(double ra,
double dec)
Sets the offset values. |
CoordinatesOffset |
subtract(CoordinatesOffset delta)
Subtracts another offset from the offset and returns a new offset which is the difference of the two. |
java.lang.String |
toString()
Returns a string representation of this offset's values. |
void |
translate(double dra,
double ddec)
Translates the offset values such that ra = ra + dra and dec = dec + ddec (degrees). |
static double |
validateRa(double ra)
Unlike Coordinates, CoordinatesOffsets can have a negative right ascension The reason is CoordinateOffsets represent deltas (+/-) to a Coordinate. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NUM_DECIMAL
Constructor Detail |
---|
public CoordinatesOffset()
public CoordinatesOffset(CoordinatesOffset co)
public CoordinatesOffset(double ra, double dec)
ra
- the right-ascensiondec
- the declinationpublic CoordinatesOffset(double ra, double dec, java.lang.String units)
ra
- the right-ascensiondec
- the declinationunits
- the source units of the ra and decMethod Detail |
---|
public double getRa()
public double getDec()
public double getRa(java.lang.String units)
public double getDec(java.lang.String units)
public void set(double ra, double dec)
public static final double validateRa(double ra)
ra
- a right-ascension of a position in degrees
public void translate(double dra, double ddec)
public CoordinatesOffset add(CoordinatesOffset delta)
delta
- add this amount to the offset
public CoordinatesOffset subtract(CoordinatesOffset delta)
delta
- subtract this amount to the offset
public void rotate(double angleRad)
angleRad
- rotation angle in radians about center point 0,0public boolean equals(java.lang.Object obj)
CoordinatesOffset
are equal if the values of their
ra
and dec
member fields, representing
their offset values in the coordinate system, are equal.
equals
in class java.lang.Object
obj
- an object to be compared with this point.
true
if the object to be compared is
an instance of CoordinatesOffset
and has
the same values; false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |