object Angle

Utility functions for working with angles. Unless otherwise noted, methods in this class express angles in radians.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Angle
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val CLOCKWISE: Int

    Constant representing clockwise orientation

  5. val COUNTERCLOCKWISE: Int

    Constant representing counterclockwise orientation

  6. val NONE: Int

    Constant representing no orientation

  7. val PI_OVER_2: Double

    The value of Pi/2

  8. val PI_OVER_4: Double

    The value of Pi/4

  9. val PI_TIMES_2: Double

    The value of 2*Pi

  10. def angle(p: Coordinate): Double

    Returns the angle of the vector from (0,0) to p, relative to the positive X-axis.

    Returns the angle of the vector from (0,0) to p, relative to the positive X-axis. The angle is normalized to be in the range ( -Pi, Pi ].

    p

    the terminal point of the vector return the normalized angle (in radians) that p makes with the positive x-axis.

  11. def angle(p0: Coordinate, p1: Coordinate): Double

    Returns the angle of the vector from p0 to p1, relative to the positive X-axis.

    Returns the angle of the vector from p0 to p1, relative to the positive X-axis. The angle is normalized to be in the range [ -Pi, Pi ].

    p0

    the initial point of the vector

    p1

    the terminal point of the vector return the normalized angle (in radians) that p0-p1 makes with the positive x-axis.

  12. def angleBetween(tip1: Coordinate, tail: Coordinate, tip2: Coordinate): Double

    Returns the unoriented smallest angle between two vectors.

    Returns the unoriented smallest angle between two vectors. The computed angle will be in the range [0, Pi).

    tip1

    the tip of one vector

    tail

    the tail of each vector

    tip2

    the tip of the other vector return the angle between tail-tip1 and tail-tip2

  13. def angleBetweenOriented(tip1: Coordinate, tail: Coordinate, tip2: Coordinate): Double

    Returns the oriented smallest angle between two vectors.

    Returns the oriented smallest angle between two vectors. The computed angle will be in the range (-Pi, Pi]. A positive result corresponds to a counterclockwise (CCW) rotation from v1 to v2; a negative result corresponds to a clockwise (CW) rotation; a zero result corresponds to no rotation.

    tip1

    the tip of v1

    tail

    the tail of each vector

    tip2

    the tip of v2 return the angle between v1 and v2, relative to v1

  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  16. def diff(ang1: Double, ang2: Double): Double

    Computes the unoriented smallest difference between two angles.

    Computes the unoriented smallest difference between two angles. The angles are assumed to be normalized to the range [-Pi, Pi]. The result will be in the range [0, Pi].

    ang1

    the angle of one vector (in [-Pi, Pi] )

    ang2

    the angle of the other vector (in range [-Pi, Pi] ) return the angle (in radians) between the two vectors (in range [0, Pi] )

  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def getTurn(ang1: Double, ang2: Double): Int

    Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.

    Returns whether an angle must turn clockwise or counterclockwise to overlap another angle.

    ang1

    an angle (in radians)

    ang2

    an angle (in radians) return whether a1 must turn CLOCKWISE, COUNTERCLOCKWISE or NONE to overlap a2.

  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def interiorAngle(p0: Coordinate, p1: Coordinate, p2: Coordinate): Double

    Computes the interior angle between two segments of a ring.

    Computes the interior angle between two segments of a ring. The ring is assumed to be oriented in a clockwise direction. The computed angle will be in the range [0, 2Pi]

    p0

    a point of the ring

    p1

    the next point of the ring

    p2

    the next point of the ring return the interior angle based at p1

  24. def isAcute(p0: Coordinate, p1: Coordinate, p2: Coordinate): Boolean

    Tests whether the angle between p0-p1-p2 is acute.

    Tests whether the angle between p0-p1-p2 is acute. An angle is acute if it is less than 90 degrees.

    Note: this implementation is not precise (deterministic) for angles very close to 90 degrees.

    p0

    an endpoint of the angle

    p1

    the base of the angle

    p2

    the other endpoint of the angle return true if the angle is acute

  25. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  26. def isObtuse(p0: Coordinate, p1: Coordinate, p2: Coordinate): Boolean

    Tests whether the angle between p0-p1-p2 is obtuse.

    Tests whether the angle between p0-p1-p2 is obtuse. An angle is obtuse if it is greater than 90 degrees.

    Note: this implementation is not precise (deterministic) for angles very close to 90 degrees.

    p0

    an endpoint of the angle

    p1

    the base of the angle

    p2

    the other endpoint of the angle return true if the angle is obtuse

  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def normalize(angl: Double): Double

    Computes the normalized value of an angle, which is the equivalent angle in the range ( -Pi, Pi ].

  29. def normalizePositive(angl: Double): Double

    Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ).

    Computes the normalized positive value of an angle, which is the equivalent angle in the range [ 0, 2*Pi ). E.g.:

    • normalizePositive(0.0) = 0.0
    • normalizePositive(-PI) = PI
    • normalizePositive(-2PI) = 0.0
    • normalizePositive(-3PI) = PI
    • normalizePositive(-4PI) = 0
    • normalizePositive(PI) = PI
    • normalizePositive(2PI) = 0.0
    • normalizePositive(3PI) = PI
    • normalizePositive(4PI) = 0.0
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  33. def toDegrees(radians: Double): Double

    Converts from radians to degrees.

    Converts from radians to degrees.

    radians

    an angle in radians return the angle in degrees

  34. def toRadians(angleDegrees: Double): Double

    Converts from degrees to radians.

    Converts from degrees to radians.

    angleDegrees

    an angle in degrees return the angle in radians

  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped