Enum Class Heading

java.lang.Object
java.lang.Enum<Heading>
com.geodesk.core.Heading
All Implemented Interfaces:
Serializable, Comparable<Heading>, Constable

public enum Heading extends Enum<Heading>
Compass headings. Keep in mind that unlike screen coordinates, planar coordinate values *increase* as one moves "up" (north).
  • Enum Constant Details

    • NORTH

      public static final Heading NORTH
    • NORTHEAST

      public static final Heading NORTHEAST
    • EAST

      public static final Heading EAST
    • SOUTHEAST

      public static final Heading SOUTHEAST
    • SOUTH

      public static final Heading SOUTH
    • SOUTHWEST

      public static final Heading SOUTHWEST
    • WEST

      public static final Heading WEST
    • NORTHWEST

      public static final Heading NORTHWEST
  • Method Details

    • values

      public static Heading[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Heading valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Heading>
    • id

      public String id()
    • northFactor

      public int northFactor()
    • eastFactor

      public int eastFactor()
    • toDegrees

      public int toDegrees()
      Heading in degrees.
      Returns:
      0 = north, 90 = east, etc.
    • reversed

      public Heading reversed()
      Returns the opposite heading.
      Returns:
      the heading that lies 180 degrees opposite.
    • turnedBy

      public Heading turnedBy(double degrees)
    • fromDegrees

      public static Heading fromDegrees(double degrees)
      Returns the Heading closest to the given compass heading in degrees (0 = north, 90 = east, etc.)
      Parameters:
      degrees - (must be 0 <= degrees < 360)
      Returns:
    • turnedBy

      public static double turnedBy(double fromDegrees, double byDegrees)
    • project

      public static Coordinate project(double angle, double distance)
      Determines the coordinate that lies a given distance from the center of the plane, in a given heading
      Parameters:
      angle - heading in degrees (0 = north, 90 = east)
      distance - distance
      Returns:
      the coordinate
    • project

      public static LineSegment project(double angle, double distance, Coordinate from)
      Parameters:
      angle -
      distance -
      from -
      Returns:
    • projectedLine

      public static LineString projectedLine(GeometryFactory factory, double angle, double distance, Coordinate from)