Class Angle

java.lang.Object
es.situm.sdk.model.location.Angle
All Implemented Interfaces:
android.os.Parcelable, MapperInterface

public class Angle extends Object implements android.os.Parcelable, MapperInterface
Representation of an angle. You can create a new angle using degrees with fromDegrees(double) or using radians with fromRadians(double)
  • Field Details

    • EMPTY

      public static final Angle EMPTY
    • CREATOR

      public static final android.os.Parcelable.Creator<Angle> CREATOR
  • Method Details

    • fromRadians

      @NonNull public static Angle fromRadians(double radians)
      Parameters:
      radians - angle in radians, increasing in counter-clockwise
    • fromDegrees

      @NonNull public static Angle fromDegrees(double degrees)
      Parameters:
      degrees - angle in degrees, increasing in counter-clockwise
    • radians

      public double radians()
      Returns:
      angle in radians, increasing in counter-clockwise
    • degrees

      public double degrees()
      Returns:
      angle in degrees, increasing in counter-clockwise
    • degreesClockwise

      public double degreesClockwise()
      Returns:
      angle in radians, increasing in clockwise
    • radiansMinusPiPi

      public double radiansMinusPiPi()
      Returns:
      angle in radians in range (-pi,pi)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable
    • toMap

      public Map<String,Object> toMap()
      Description copied from interface: MapperInterface
      Method to transform object into Map<String, Object>
      Specified by:
      toMap in interface MapperInterface
      Returns:
      Map<String, Object> with the information of the object mapped
    • fromMap

      public static Angle fromMap(Map<String,Object> map) throws IllegalArgumentException
      Return a new Angle instance object containing the data at the given map. Use MapperInterface to populate the Map. The expected fields are those defined at this class.
      Parameters:
      map - Map containing the data used to populate the new object.
      Returns:
      New instance.
      Throws:
      IllegalArgumentException - If there is not enough information at the given map or it is incorrect.