Class AngularUnit
- java.lang.Object
-
- com.esri.arcgisruntime.geometry.Unit
-
- com.esri.arcgisruntime.geometry.AngularUnit
-
public final class AngularUnit extends Unit
Indicates the units of an angular measurement, for example the units of a geographic spatial reference, or angle measurement operation.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 theconstructor
. To use less common angular units not available in the AngularUnitId enum, call theUnit.fromUnitId(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.getUnitId()
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 theconvertTo(com.esri.arcgisruntime.geometry.AngularUnit, double)
andconvertFrom(com.esri.arcgisruntime.geometry.AngularUnit, double)
methods to convert between different angular units. Convenience methods are also available to convertfrom
andto
Radians. All unit names and abbreviations returned fromUnit.getName()
,Unit.getDisplayName()
,Unit.getPluralDisplayName()
, andUnit.getAbbreviation()
are returned in English.- Since:
- 100.0.0
- See Also:
Unit
,AngularUnitId
,SpatialReference.isGeographic()
-
-
Constructor Summary
Constructors Constructor Description AngularUnit(AngularUnitId unitId)
Creates a new angular unit from an AngularUnitId value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
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.AngularUnitId
getAngularUnitId()
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
fromUnitId, fromWkid, getAbbreviation, getDisplayName, getName, getPluralDisplayName, getUnitId, getUnitType, getWkid
-
-
-
-
Constructor Detail
-
AngularUnit
public AngularUnit(AngularUnitId unitId)
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.fromUnitId(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:
Unit.fromUnitId(int)
-
-
Method Detail
-
getAngularUnitId
public AngularUnitId 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
public double convertFrom(AngularUnit fromUnit, double angle)
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:
fromRadians(double)
-
convertTo
public double convertTo(AngularUnit toUnit, double angle)
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:
toRadians(double)
-
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
-
-