Packages

class Vector2D extends AnyRef

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

Instance Constructors

  1. new Vector2D(v: Coordinate)
  2. new Vector2D(from: Coordinate, to: Coordinate)
  3. new Vector2D(v: Vector2D)

    The Y component of this vector.

  4. new Vector2D(x: Double = 0.0, y: Double = 0.0)

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. def add(v: Vector2D): Vector2D
  5. def angle(v: Vector2D): Double
  6. def angle: Double
  7. def angleTo(v: Vector2D): Double
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def average(v: Vector2D): Vector2D
  10. def clone(): Vector2D

    Creates a copy of this vector

    Creates a copy of this vector

    return a copy of this vector

    Definition Classes
    Vector2D → AnyRef
  11. def distance(v: Vector2D): Double

    Computes the distance between this vector and another one.

    Computes the distance between this vector and another one.

    v

    a vector return the distance between the vectors

  12. def divide(d: Double): Vector2D

    Divides the vector by a scalar value.

    Divides the vector by a scalar value.

    d

    the value to divide by return a new vector with the value v / d

  13. def dot(v: Vector2D): Double

    Computes the dot-product of two vectors

    Computes the dot-product of two vectors

    v

    a vector return the dot product of the vectors

  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(o: Any): Boolean

    Tests if a vector o has the same values for the x and y components.

    Tests if a vector o has the same values for the x and y components.

    o

    a Vector2D with which to do the comparison. return true if other is a Vector2D with the same values for the x and y components.

    Definition Classes
    Vector2D → AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def getComponent(index: Int): Double
  19. def getX: Double
  20. def getY: Double
  21. def hashCode(): Int

    Gets a hashcode for this vector.

    Gets a hashcode for this vector.

    return a hashcode for this vector

    Definition Classes
    Vector2D → AnyRef → Any
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def isParallel(v: Vector2D): Boolean
  24. def length: Double
  25. def lengthSquared: Double
  26. def multiply(d: Double): Vector2D

    Multiplies the vector by a scalar value.

    Multiplies the vector by a scalar value.

    d

    the value to multiply by return a new vector with the value v * d

  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def negate: Vector2D
  29. def normalize: Vector2D
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. def rotate(angle: Double): Vector2D
  33. def rotateByQuarterCircle(numQuarters: Int): Vector2D

    Rotates a vector by a given number of quarter-circles (i.e.

    Rotates a vector by a given number of quarter-circles (i.e. multiples of 90 degrees or Pi/2 radians). A positive number rotates counter-clockwise, a negative number rotates clockwise. Under this operation the magnitude of the vector and the absolute values of the ordinates do not change, only their sign and ordinate index.

    numQuarters

    the number of quarter-circles to rotate by return the rotated vector.

  34. def subtract(v: Vector2D): Vector2D
  35. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  36. def toCoordinate: Coordinate
  37. def toString(): String

    Gets a string representation of this vector

    Gets a string representation of this vector

    return a string representing this vector

    Definition Classes
    Vector2D → AnyRef → Any
  38. def translate(coord: Coordinate): Coordinate
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  42. def weightedSum(v: Vector2D, frac: Double): Vector2D

    Computes the weighted sum of this vector with another vector, with this vector contributing a fraction of frac to the total.

    Computes the weighted sum of this vector with another vector, with this vector contributing a fraction of frac to the total.

    In other words,

    sum = frac * this + (1 - frac) * v
    

    v

    the vector to sum

    frac

    the fraction of the total contributed by this vector return the weighted sum of the two vectors

  43. val x: Double
    Attributes
    protected
  44. val y: Double
    Attributes
    protected

Inherited from AnyRef

Inherited from Any

Ungrouped