Instances of AngularUnit are immutable. Create instances representing the most commonly used angular units (for example
degrees or radians) by passing an AngularUnitId
value to the constructor
.
To use less common angular units not available in the AngularUnitId enum, call the Unit.fromWkid(int)
factory
method passing in a well-known ID of an angular unit.
Different units of measurement have different ID numbers, often known as Well-Known IDs (WKIDs). The WKID
of an AngularUnit is returned by the inherited Unit.getWkid()
method. The supported WKIDs are documented in the
'Geographic coordinate systems' table in the developer Guide.
Coordinates in geographic coordinate systems
are defined in AngularUnits.
Use the convertTo(com.esri.arcgisruntime.geometry.AngularUnit, double)
and convertFrom(com.esri.arcgisruntime.geometry.AngularUnit, double)
methods to convert between different angular units. Convenience
methods are also available to convert from
and to
Radians.
All unit names and abbreviations returned from Unit.getName()
, Unit.getDisplayName()
,
Unit.getPluralDisplayName()
, and Unit.getAbbreviation()
are returned in English.
- Since:
- 100.0.0
- See Also:
-
Constructor Summary
ConstructorDescriptionAngularUnit
(AngularUnitId unitId) Creates a new angular unit from an AngularUnitId value. -
Method Summary
Modifier and TypeMethodDescriptiondouble
convertFrom
(AngularUnit fromUnit, double angle) Converts a value from the given units to the units of this instance.double
convertTo
(AngularUnit toUnit, double angle) Converts a value from the units of this instance to the given units.double
fromRadians
(double radians) Converts a value from radians to the units of this instance.Gets the AngularUnitId value for the type of angular units represented by this instance.double
toRadians
(double angle) Converts a value from the units of this instance to radians.Methods inherited from class com.esri.arcgisruntime.geometry.Unit
fromWkid, getAbbreviation, getDisplayName, getName, getPluralDisplayName, getUnitType, getWkid
-
Constructor Details
-
AngularUnit
Creates a new angular unit from an AngularUnitId value. Use this constructor to create an instance of AngularUnit representing any of the most commonly used angular units defined in theAngularUnitId
enumeration.To use less common angular units not available in the enumeration, call the
Unit.fromWkid(int)
factory method passing in a well-known ID of an angular unit.- Parameters:
unitId
- the id of the angular unit to create- Since:
- 100.0.0
- See Also:
-
-
Method Details
-
getAngularUnitId
Gets the AngularUnitId value for the type of angular units represented by this instance.- Returns:
- the angular unit ID
- Since:
- 100.0.0
-
convertFrom
Converts a value from the given units to the units of this instance.- Parameters:
fromUnit
- the units to convert the value fromangle
- the value to convert, infromUnit
units- Returns:
- the value converted to the units represented by this instance
- Throws:
IllegalArgumentException
- iffromUnit
is null- Since:
- 100.0.0
- See Also:
-
convertTo
Converts a value from the units of this instance to the given units.- Parameters:
toUnit
- the units to convert the value toangle
- the value to convert, in the units represented by this instance- Returns:
- the value converted to the
toUnit
units - Throws:
IllegalArgumentException
- iftoUnit
is null- Since:
- 100.0.0
- See Also:
-
fromRadians
public double fromRadians(double radians) Converts a value from radians to the units of this instance. This is a convenience method for the common task of conversion of angular measurements from radians. Use theconvertFrom(AngularUnit, double)
method to convert values from other angular units.- Parameters:
radians
- the value to convert, in radians- Returns:
- the value converted to the units represented by this instance
- Since:
- 100.0.0
-
toRadians
public double toRadians(double angle) Converts a value from the units of this instance to radians. This is a convenience method for the common task of conversion of angular measurements to radians. Use theconvertTo(AngularUnit, double)
method to convert values to other angular units.- Parameters:
angle
- the value to convert, in the units represented by this instance- Returns:
- the value converted to radians
- Since:
- 100.0.0
-