|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<ArcUnits> edu.nrao.sss.measure.ArcUnits
public enum ArcUnits
Units of arc.
Table of Units
Element | Name1 | Symbol1 | HTML Symbol2 | Units per Circle |
---|---|---|---|---|
DEGREE | DEGREE | d 3 | ° (°) | 360.0 |
RADIAN | RADIAN | rad | rad | 2π |
PERCENT | PERCENT | % | &#x0025; (%) | 100.0 |
HOUR | HOUR | h | h | 24.0 |
MINUTE | MINUTE | m | m | 1,440.0 |
SECOND | SECOND | s | s | 86,400.0 |
ARC_MINUTE | ARC_MINUTE | ' | ' (') | 21,600.0 |
ARC_SECOND | ARC_SECOND | " | " (") | 1,296,000.0 |
MILLI_ARC_SECOND | MILLI_ARC_SECOND | mas | mas | 1,296,000,000.0 |
fromString(String)
. Note that the names are
not case sensitive.Table of Conversion Factors4
Element | d | rad | % | h | m | s | ' | " | mas |
---|---|---|---|---|---|---|---|---|---|
DEGREE | 1.0 | 0.01745329251994329444444444444444444 | 0.2777777777777777777777777777777778 | 0.06666666666666666666666666666666667 | 4.0 | 240.0 | 60.0 | 3600.0 | 3600000.0 |
RADIAN | 57.29577951308232522583526558752712 | 1.0 | 15.91549430918953478495424044097976 | 3.819718634205488348389017705835142 | 229.1831180523293009033410623501085 | 13750.98708313975805420046374100651 | 3437.746770784939513550115935251627 | 206264.8062470963708130069561150976 | 206264806.2470963708130069561150976 |
PERCENT | 3.6 | 0.06283185307179586 | 1.0 | 0.24 | 14.4 | 864.0 | 216.0 | 12960.0 | 12960000.0 |
HOUR | 15.0 | 0.2617993877991494166666666666666667 | 4.166666666666666666666666666666667 | 1.0 | 60.0 | 3600.0 | 900.0 | 54000.0 | 54000000.0 |
MINUTE | 0.25 | 0.004363323129985823611111111111111111 | 0.06944444444444444444444444444444444 | 0.01666666666666666666666666666666667 | 1.0 | 60.0 | 15.0 | 900.0 | 900000.0 |
SECOND | 0.004166666666666666666666666666666667 | 0.00007272205216643039351851851851851852 | 0.001157407407407407407407407407407407 | 0.0002777777777777777777777777777777778 | 0.01666666666666666666666666666666667 | 1.0 | 0.25 | 15.0 | 15000.0 |
ARC_MINUTE | 0.01666666666666666666666666666666667 | 0.0002908882086657215740740740740740741 | 0.004629629629629629629629629629629630 | 0.001111111111111111111111111111111111 | 0.06666666666666666666666666666666667 | 4.0 | 1.0 | 60.0 | 60000.0 |
ARC_SECOND | 0.0002777777777777777777777777777777778 | 0.000004848136811095359567901234567901235 | 0.00007716049382716049382716049382716049 | 0.00001851851851851851851851851851851852 | 0.001111111111111111111111111111111111 | 0.06666666666666666666666666666666667 | 0.01666666666666666666666666666666667 | 1.0 | 1000.0 |
MILLI_ARC_SECOND | 2.777777777777777777777777777777778E-7 | 4.848136811095359567901234567901235E-9 | 7.716049382716049382716049382716049E-8 | 1.851851851851851851851851851851852E-8 | 0.000001111111111111111111111111111111111 | 0.00006666666666666666666666666666666667 | 0.00001666666666666666666666666666666667 | 0.001 | 1.0 |
Version Info:
$Revision: 1586 $ |
$Date: 2008-10-01 10:38:49 -0600 (Wed, 01 Oct 2008) $ |
$Author: dharland $ |
Enum Constant Summary | |
---|---|
ARC_MINUTE
One sixtieth of a degree. |
|
ARC_SECOND
One sixtieth of an arc minute. |
|
DEGREE
A degree. |
|
HOUR
An hour angle. |
|
MILLI_ARC_SECOND
One thousandth of an arc second. |
|
MINUTE
One sixtieth of an hour angle. |
|
PERCENT
Percent of a full circle. |
|
RADIAN
A radian. |
|
SECOND
One sixtieth of a minute. |
Method Summary | |
---|---|
static BigDecimal |
convertDmsTo(ArcUnits otherUnits,
int degrees,
int minutes,
BigDecimal seconds)
Converts from degrees-minutes-seconds to otherUnits . |
static BigDecimal |
convertHmsTo(ArcUnits otherUnits,
int hours,
int minutes,
BigDecimal seconds)
Converts from hours-minutes-seconds to otherUnits . |
Number[] |
convertToDms(BigDecimal value)
Converts value , expressed in this unit, to degrees-minutes-seconds. |
Number[] |
convertToHms(BigDecimal value)
Converts value , expressed in this unit, to hours-minutes-seconds. |
static ArcUnits |
fromString(String text)
Returns the arc units represented by text . |
static ArcUnits |
getDefault()
Returns a default unit of arc. |
String |
getHtmlSymbol()
Returns a symbol for this unit that may be more appropriate for use in HTML than the main symbol. |
String |
getSymbol()
Returns the symbol for this unit. |
boolean |
symbolsAreCaseSensitive()
Returns false -- these symbols are not case sensitive. |
BigDecimal |
toFullCircle()
Returns the number of these units in a full circle. |
BigDecimal |
toHalfCircle()
Returns the number of these units in one half of a circle. |
BigDecimal |
toQuarterCircle()
Returns the number of these units in one quarter a circle. |
String |
toString()
Returns a text representation of this enumeration constant. |
BigDecimal |
toUnits(ArcUnits otherUnits)
Returns a factor for converting from this unit to otherUnits . |
static ArcUnits |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static ArcUnits[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final ArcUnits DEGREE
public static final ArcUnits RADIAN
public static final ArcUnits PERCENT
public static final ArcUnits HOUR
public static final ArcUnits MINUTE
ARC_MINUTE
.
public static final ArcUnits SECOND
ARC_SECOND
.
public static final ArcUnits ARC_MINUTE
MINUTE
.
public static final ArcUnits ARC_SECOND
SECOND
.
public static final ArcUnits MILLI_ARC_SECOND
Method Detail |
---|
public static ArcUnits[] values()
for (ArcUnits c : ArcUnits.values()) System.out.println(c);
public static ArcUnits valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic boolean symbolsAreCaseSensitive()
symbolsAreCaseSensitive
in interface Symbolic
public String getSymbol()
DEGREE
is d.
getSymbol
in interface Symbolic
public String getHtmlSymbol()
ARC_MINUTE
and ARC_SECOND
. For
most units, the HTML symbol is the same as the main symbol.
public BigDecimal toFullCircle()
public BigDecimal toHalfCircle()
public BigDecimal toQuarterCircle()
public BigDecimal toUnits(ArcUnits otherUnits)
otherUnits
.
otherUnits
- the unit to which conversion is desired.
otherUnits
.public Number[] convertToDms(BigDecimal value)
value
, expressed in this unit, to degrees-minutes-seconds.
value
- the quantity, in this unit, to be converted to DMS.
public Number[] convertToHms(BigDecimal value)
value
, expressed in this unit, to hours-minutes-seconds.
value
- the quantity, in this unit, to be converted to DMS.
public static BigDecimal convertDmsTo(ArcUnits otherUnits, int degrees, int minutes, BigDecimal seconds)
otherUnits
.
At most, only one of degrees
, minutes
, or seconds
may be negative. Further more, if one of these is negative, the higher
units must all be zero. E.g., in order for seconds
to be negative
both degrees
and minutes
must be zero. If these conditions
are not met, an IllegalArgumentException
is thrown.
otherUnits
- the units in which the value is returned.degrees
- the whole number of degrees of arc.minutes
- the whole number of minutes of arc. The normal
range for this value is [0-59].seconds
- the whole and fraction number of seconds of arc.
The normal range for this value is [0.0-60.0).
degrees, minutes, seconds
converted
to otherUnits
.
IllegalArgumentException
- if the rules about negative parameters
described above are violated.public static BigDecimal convertHmsTo(ArcUnits otherUnits, int hours, int minutes, BigDecimal seconds)
otherUnits
.
At most, only one of hours
, minutes
, or seconds
may be negative. Further more, if one of these is negative, the higher
units must all be zero. E.g., in order for seconds
to be negative
both hours
and minutes
must be zero. If these conditions
are not met, an IllegalArgumentException
is thrown.
otherUnits
- the units in which the value is returned.hours
- the whole number of angle hours.minutes
- the whole number of angle minutes. The normal
range for this value is [0-59].seconds
- the whole and fraction number of angle seconds.
The normal range for this value is [0.0-60.0).
hours, minutes, seconds
converted
to otherUnits
.
IllegalArgumentException
- if the rules about negative parameters
described above are violated.public static ArcUnits getDefault()
public String toString()
toString
in class Enum<ArcUnits>
public static ArcUnits fromString(String text)
text
.
For details about the transformation, see
EnumerationUtility.enumFromString(Class, String)
.
text
- a text representation of a unit of arc.
text
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |