Package csw.params.core.models
Class Angle$
java.lang.Object
csw.params.core.models.Angle$
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
assertDe
(double de) void
assertRa
(double ra) protected long
CIRCLE()
double
D2H()
multiply to convert degrees to archoursint
D2M()
multiply to convert degrees to arcminuteint
D2Mas()
multiply to convert degrees to milliarcsecondsdouble
D2R()
multiply to convert degrees to radiansint
D2S()
multiply to convert degrees to arcsecondlong
D2Uas()
multiply to convert degrees to microarcsecondschar
round circle which marks degreesdeToString
(double de2, boolean withColon) Converts DE to a string in the format 01:02:03.333 (or '1d 2m 3.333s)' Minutes and seconds are auto added as needed.double
distance
(double ra1, double de1, double ra2, double de2) calculate great circle distance of two points, coordinates are given in radiansdouble2angle
(double d) double
H2D()
multiply to convert archour to degreesint
H2Mas()
multiply to convert hours to milliarcsecondsdouble
H2R()
multiply to convert hours to radianslong
H2Uas()
multiply to convert hours to microarcsecondsint
HMin2Mas()
multiply to convert time minutes to milliarcsecondslong
HMin2Uas()
multiply to convert time minutes to microarcsecondsint
HSec2Mas()
multiply to convert time seconds to milliarcsecondslong
HSec2Uas()
multiply to convert time seconds to microarcsecondsint2angle
(int d) long2angle
(long d) double
M2D()
multiply to convert arcminute to toDegreeint
M2Mas()
multiply to convert minutes to milliarcsecondsdouble
M2R()
multiply to convert minutes to radianslong
M2Uas()
multiply to convert minutes to microarcsecondsdouble
Mas2R()
multiply to convert milliarcseconds to radiansreturns maximal angle from two optionsreturns minimal angle from two optionsdouble
normalizeRa
(double ra2) normalize RA into 0 - 2 * PI rangeTries to parse Angle from string.Parse Declination from four values.Tries to parse Angle from string.parse Right ascencion from triple values raHour raMin, raSec This method uses big decimal, so there are no rounding errorsParses pair of RA and De coordinates.double
R2D()
multiply to convert radians to degreesdouble
R2H()
multiply to convert radians to hoursdouble
R2M()
multiply to convert radians to minutesdouble
R2Mas()
multiply to convert radians to milliarcsecondsdouble
R2S()
multiply to convert radians to arcsecondsdouble
R2Uas()
multiply to convert radians to microarcsecondsrandomDe()
returns random angle with value between -PI/2 and + PI/2randomRa()
returns random angle with value between 0 and 2*PIraToString
(double ra, boolean withColon) Converts RA to a string in the format 01:02:03.333 (or '1h 2m 3.33s').double
S2D()
multiply to convert arcsecond to toDegreeint
S2Mas()
multiply to convert Seconds to milliarcsecondsdouble
S2R()
multiply to convert arcseconds to radianslong
S2Uas()
multiply to convert Seconds to microarcsecondsdouble
Uas2D()
multiply to convert UAS to degreesdouble
Uas2M()
multiply to convert UAS to minutesdouble
Uas2R()
multiply to convert microarcseconds to radiansdouble
Uas2S()
multiply to convert UAS to Seconds
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
Angle$
public Angle$()
-
-
Method Details
-
CIRCLE
protected long CIRCLE() -
long2angle
-
int2angle
-
double2angle
-
randomRa
returns random angle with value between 0 and 2*PI -
randomDe
returns random angle with value between -PI/2 and + PI/2 -
max
returns maximal angle from two options -
min
returns minimal angle from two options -
parseDe
Parse Declination from four values. It uses BigDecimal, so there are no rounding errors- Parameters:
deSign
- signum (ie + or -)deDegree
- declination in degreesdeMin
- remaining part in arcminutesdeSec
- remaining part in arcseconds- Returns:
- declination in microarcseconds
-
parseDe
Tries to parse Angle from string. It knows common formats used for Declination- Parameters:
de
- (undocumented)- Returns:
- (undocumented)
-
parseRa
parse Right ascencion from triple values raHour raMin, raSec This method uses big decimal, so there are no rounding errors- Parameters:
raHour
- ra hours value as StringraMin
- ra minutes value as StringraSec
- ra seconds value as String- Returns:
- result in microarcseconds
-
parseRa
Tries to parse Angle from string. It knows common formats used for Right ascencion (including hours)- Parameters:
ra
- (undocumented)- Returns:
- (undocumented)
-
parseRaDe
Parses pair of RA and De coordinates. This method should handle formats used in vizier. An example: The following writings are allowed:20 54 05.689 +37 01 17.38, 10:12:45.3-45:17:50, 15h17m-11d10m, 15h17+89d15, 275d11m15.6954s+17d59m59.876s 12.34567h-17.87654d, 350.123456d-17.33333d <=> 350.123456 -17.33333
- Parameters:
str
- (undocumented)- Returns:
- (undocumented)
-
normalizeRa
public double normalizeRa(double ra2) normalize RA into 0 - 2 * PI range- Parameters:
ra2
- (undocumented)- Returns:
- (undocumented)
-
assertRa
public void assertRa(double ra) -
assertDe
public void assertDe(double de) -
raToString
Converts RA to a string in the format 01:02:03.333 (or '1h 2m 3.33s'). Minutes and seconds are auto added as needed.- Parameters:
ra
- in radianswithColon
- if true format as hh:mm:ss.sss, otherwise XXh XXm XXs- Returns:
- ra in string form
-
deToString
Converts DE to a string in the format 01:02:03.333 (or '1d 2m 3.333s)' Minutes and seconds are auto added as needed.- Parameters:
de2
- in radianswithColon
- if true format as dd:mm:ss.sss, otherwise XXd XXm XXs- Returns:
- de in string form
-
distance
public double distance(double ra1, double de1, double ra2, double de2) calculate great circle distance of two points, coordinates are given in radians- Parameters:
ra1
- (undocumented)de1
- (undocumented)ra2
- (undocumented)de2
- (undocumented)- Returns:
- distance of two points in radians
-
D2R
public double D2R()multiply to convert degrees to radians -
R2D
public double R2D()multiply to convert radians to degrees -
D2H
public double D2H()multiply to convert degrees to archours -
H2D
public double H2D()multiply to convert archour to degrees -
D2M
public int D2M()multiply to convert degrees to arcminute -
M2D
public double M2D()multiply to convert arcminute to toDegree -
D2S
public int D2S()multiply to convert degrees to arcsecond -
S2D
public double S2D()multiply to convert arcsecond to toDegree -
H2R
public double H2R()multiply to convert hours to radians -
R2H
public double R2H()multiply to convert radians to hours -
R2M
public double R2M()multiply to convert radians to minutes -
M2R
public double M2R()multiply to convert minutes to radians -
Mas2R
public double Mas2R()multiply to convert milliarcseconds to radians -
Uas2R
public double Uas2R()multiply to convert microarcseconds to radians -
R2Mas
public double R2Mas()multiply to convert radians to milliarcseconds -
R2Uas
public double R2Uas()multiply to convert radians to microarcseconds -
H2Mas
public int H2Mas()multiply to convert hours to milliarcseconds -
HMin2Mas
public int HMin2Mas()multiply to convert time minutes to milliarcseconds -
HSec2Mas
public int HSec2Mas()multiply to convert time seconds to milliarcseconds -
H2Uas
public long H2Uas()multiply to convert hours to microarcseconds -
HMin2Uas
public long HMin2Uas()multiply to convert time minutes to microarcseconds -
HSec2Uas
public long HSec2Uas()multiply to convert time seconds to microarcseconds -
D2Mas
public int D2Mas()multiply to convert degrees to milliarcseconds -
M2Mas
public int M2Mas()multiply to convert minutes to milliarcseconds -
S2Mas
public int S2Mas()multiply to convert Seconds to milliarcseconds -
D2Uas
public long D2Uas()multiply to convert degrees to microarcseconds -
M2Uas
public long M2Uas()multiply to convert minutes to microarcseconds -
S2Uas
public long S2Uas()multiply to convert Seconds to microarcseconds -
Uas2D
public double Uas2D()multiply to convert UAS to degrees -
Uas2M
public double Uas2M()multiply to convert UAS to minutes -
Uas2S
public double Uas2S()multiply to convert UAS to Seconds -
S2R
public double S2R()multiply to convert arcseconds to radians -
R2S
public double R2S()multiply to convert radians to arcseconds -
DEGREE_SIGN
public char DEGREE_SIGN()round circle which marks degrees
-