public class CoordinatesOffset extends Object implements Serializable
This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project.
Modifier and Type | Field and Description |
---|---|
static int |
NUM_DECIMAL
Number of decimal places to show when displaying as string
|
Constructor and Description |
---|
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,
String units)
Constructs and initializes an offset with the specified values in specified units
|
Modifier and Type | Method and Description |
---|---|
CoordinatesOffset |
add(CoordinatesOffset delta)
Adds another offset to the offset and returns a new offset which is the sum of the two.
|
boolean |
equals(Object obj)
Determines whether two offsets are equal.
|
double |
getDec()
Returns the declination offset in degrees.
|
double |
getDec(String units)
Returns the declination offset in specified units
|
double |
getRa()
Returns the right-ascension offset in degrees.
|
double |
getRa(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.
|
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.
|
public static final int NUM_DECIMAL
public CoordinatesOffset()
public CoordinatesOffset(CoordinatesOffset co)
public CoordinatesOffset(double ra, double dec)
ra
- the right-ascensiondec
- the declinationpublic CoordinatesOffset(double ra, double dec, String units)
ra
- the right-ascensiondec
- the declinationthe
- source units of the ra and decpublic double getRa()
public double getDec()
public double getRa(String units)
public double getDec(String units)
public void set(double ra, double dec)
public static final double validateRa(double ra)
ra
- a right-ascension of a position in degreespublic void translate(double dra, double ddec)
public CoordinatesOffset add(CoordinatesOffset delta)
delta
- add this amount to the offsetpublic CoordinatesOffset subtract(CoordinatesOffset delta)
delta
- subtract this amount to the offsetpublic void rotate(double angleRad)
angleRad
- rotation angle in radians about center point 0,0ra
- rotate about a center point with this radec
- rotate about a center point with this decpublic boolean equals(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.Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.