java.lang.Object
java.lang.Number
io.jenetics.jpx.Degrees
- All Implemented Interfaces:
Serializable,Comparable<Degrees>
Used for bearing, heading, course. Base unit is decimal degree. Only values
in the range of
[0..360] are valid.- Since:
- 1.0
- Version:
- 2.0
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintdoubleReturn the decimal degree value.booleanfloatinthashCode()intintValue()longstatic DegreesofDegrees(double degrees) Create a newDegreesobject with the given decimal degree value.static DegreesofRadians(double radians) Create a newDegreesobject with the given radians value.doubleReturn the decimal degree value.doubleReturn the degrees in radians.toString()Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
MIN_VALUE
A constant holding the maximum value aDegreesvalue can have, 0 inclusively.- Since:
- 2.0
- See Also:
-
MAX_VALUE
A constant holding the maximum value aDegreesvalue can have, 360 inclusively.- Since:
- 2.0
- See Also:
-
-
Method Details
-
doubleValue
Return the decimal degree value.- Specified by:
doubleValuein classNumber- Returns:
- the decimal degree value
-
toRadians
Return the degrees in radians.- Returns:
- the degrees in radians
-
toDegrees
Return the decimal degree value.- Returns:
- the decimal degree value
-
intValue
-
longValue
-
floatValue
- Specified by:
floatValuein classNumber
-
compareTo
- Specified by:
compareToin interfaceComparable<Degrees>
-
hashCode
-
equals
-
toString
-
ofDegrees
Create a newDegreesobject with the given decimal degree value.- Parameters:
degrees- the decimal degree value- Returns:
- a new
Degreesobject - Throws:
IllegalArgumentException- if the give value is not within the range of[0..360]
-
ofRadians
Create a newDegreesobject with the given radians value.- Parameters:
radians- the radians value- Returns:
- a new
Degreesobject - Throws:
IllegalArgumentException- if the give value is not within the range of[0..2*Pi]
-