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 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 Details

    • 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 the AngularUnitId 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

      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 from
      angle - the value to convert, in fromUnit units
      Returns:
      the value converted to the units represented by this instance
      Throws:
      IllegalArgumentException - if fromUnit is null
      Since:
      100.0.0
      See Also:
    • 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 to
      angle - the value to convert, in the units represented by this instance
      Returns:
      the value converted to the toUnit units
      Throws:
      IllegalArgumentException - if toUnit 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 the convertFrom(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 the convertTo(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