A cardinal or intercardinal direction.
The directions between the cardinal directions.
Calculates the approximate CardinalDirection from an angle in radians.
If you want to find the nearest direction of any type, use fromAngle.
Direction.fromAngle(0) // Direction.NORTH
Direction.fromAngle(Math.PI) // Direction.SOUTH
Angle in radians
Approximate cardinal direction
Calculates the approximate direction from an angle in radians.
Direction.fromAngle(0) // Direction.NORTH
Direction.fromAngle(Math.PI) // Direction.SOUTH
Angle in radians
Approximate direction
Calculates the angle of a given direction.
Direction.toAngle(Direction.NORTH) // 0
Direction.toAngle(Direction.SOUTH) // Math.PI
Angle in radians
Rotates a direction by 180 degrees.
Rotates a direction by 45 degrees in a counterclockwise direction.
Rotates a direction by 90 degrees in a counterclockwise direction.
Rotates a direction by 45 degrees in a clockwise direction.
Rotates a direction by 90 degrees in a clockwise direction.
Returns the approximate cardinal direction of a vector.
Generated using TypeDoc
The four points on a compass.