Packages

final class Vec2 extends ProdDbl2

A 2 dimensional vector, can be used to represent 2 dimensional points and translations of 2 dimensional points. Thanks to Rene Descarte this was a great idea.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Vec2
  2. ProdDbl2
  3. ProdHomo
  4. SpecialT
  5. Product2
  6. Product
  7. Equals
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Vec2(x: Double, y: Double)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def *(factor: Double): Vec2
    Annotations
    @inline()
  4. def +(operand: Vec2): Vec2

    Adds this Vector to a second 2 dimensional vector.

  5. def -(operand: Vec2): Vec2

    Subtracts the operand 2-idmensianl vecotr from this 2-dimensional vector.

  6. def /(divisor: Double): Vec2
    Annotations
    @inline()
  7. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def _1: Double
    Definition Classes
    Vec2 → Product2
    Annotations
    @inline()
  9. def _2: Double
    Definition Classes
    Vec2 → Product2
    Annotations
    @inline()
  10. def addX(adj: Double): Vec2
  11. def addXY(otherX: Double, otherY: Double): Vec2
  12. def addY(adj: Double): Vec2
  13. def alignMatrix(matrix: AlignMatrix): Vec2
  14. def angle: Angle

    Gives the angle of the vector with respect of the origin.

  15. def angleRadians: Double

    Gives the angle of the vector with respect of the origin in radians.

  16. def angleRadiansPos: Double

    Gives the angle of the vector with respect of the origin in radians.

  17. def arcControlPoint(pt2: Vec2, arcCentre: Vec2): Vec2
  18. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  19. def canEqual(other: Any): Boolean
    Definition Classes
    Vec2 → Equals
  20. def centreSquare(length: Double): PolygonImp
  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  22. def distTo(operand: Vec2): Double

    Gives the positive scalar distance between this and the operand Vec2.

  23. def dot(operand: Vec2): Double

    The dot product of this and the operand vector.

    The dot product of this and the operand vector.

    Annotations
    @inline()
  24. def doublesSeq: Seq[Double]
  25. def drawCross(armLength: Double, lineColour: Colour, lineWidth: Double): LinesDraw

    Not sure about this method

  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(other: Any): Boolean
    Definition Classes
    Vec2 → Equals → AnyRef → Any
  28. def fillText(str: String, fontSize: Int, fontColour: Colour = Colour.Black): TextGraphic
  29. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. def inverseY: Vec2

    Reverses the y coordinate.

    Reverses the y coordinate. Useful for translating between canvases where the y axis measures down and coordinate systems where y is up

  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. def lineAlong(angle: Angle, magnitude: Double): LineSeg

    Not sure about this method.

  34. def lineTo(pt2: Vec2): LineSeg
  35. def linesCross(armLength: Double = 5): Seq[LineSeg]
  36. def magnitude: Double

    The magnitude of this vector.

  37. def midPtTo(otherPt: Vec2): Vec2
  38. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. def negX: Vec2

    Reflects, mirrors along the Y axis by negating X.

  40. def negY: Vec2

    Reflects ,mirrors along the X axis by negating Y.

  41. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  42. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  43. def productArity: Int
    Definition Classes
    Product2 → Product
  44. def productElement(n: Int): Any
    Definition Classes
    Product2 → Product
    Annotations
    @throws(classOf[java.lang.IndexOutOfBoundsException])
  45. def productElementName(n: Int): String
    Definition Classes
    Product
  46. def productElementNames: Iterator[String]
    Definition Classes
    Product
  47. def productIterator: Iterator[Any]
    Definition Classes
    Product
  48. def productPrefix: String
    Definition Classes
    Vec2 → Product
  49. def prolign(m: ProlignMatrix): Vec2
    Annotations
    @inline()
  50. def reflect(lineLike: LineLike): Vec2

    Reflects or mirrors this across a line.

  51. def reflectXLine(line: XLine): Vec2

    Reflects, mirrors this Vec2 across an XLine.

  52. def reflectXParallel(yOffset: Double): Vec2

    Reflects, mirrors along the y = yOffset line that is parallel to the X axis.

  53. def reflectYLine(line: YLine): Vec2

    Reflects, mirrors this Vec2 across a YLine.

  54. def reflectYParallel(xOffset: Double): Vec2

    Reflects, mirrors along the x = xOffset line, that is parallel to the Y axis by negating X.

  55. def rotate(a: Angle): Vec2

    Rotates this vector through the given angle around the origin.

  56. def rotate180: Vec2

    Rotates the vector 180 degrees or Pi radians.

    Rotates the vector 180 degrees or Pi radians.

    Annotations
    @inline()
  57. def rotate270: Vec2

    rotates the vector 90 degrees or Pi/2 radians, clockwise.

    rotates the vector 90 degrees or Pi/2 radians, clockwise.

    Annotations
    @inline()
  58. def rotate90: Vec2

    rotates the vector 90 degrees or Pi/2 radians, anticlockwise.

    rotates the vector 90 degrees or Pi/2 radians, anticlockwise.

    Annotations
    @inline()
  59. def rotateRadians(r: Double): Vec2
  60. def str1: String
  61. def str2: String
  62. def str3: String
  63. def strMod(f: (Double) => String): String
  64. def subX(adj: Double): Vec2
  65. def subXY(otherX: Double, otherY: Double): Vec2
  66. def subY(adj: Double): Vec2
  67. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  68. def toLatLong(radius: Double): LatLong

    Where xnd y is a map on the surface ofa sphere.

    Where xnd y is a map on the surface ofa sphere. Currently not working for angles greater than Pi / 2

  69. def toPair: (Double, Double)
  70. def toString(): String
    Definition Classes
    Vec2 → AnyRef → Any
  71. def toTuple: (Double, Double)
  72. def unary_-: Vec2
  73. def vv(z: Double): Vec3
  74. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  75. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  76. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  77. val x: Double
  78. def xScale(factor: Double): Vec2
  79. def xShear(operand: Double): Vec2
  80. def xyScale(xOperand: Double, yOperand: Double): Vec2
  81. val y: Double
  82. def yScale(factor: Double): Vec2
  83. def yShear(operand: Double): Vec2

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from ProdDbl2

Inherited from ProdHomo

Inherited from SpecialT

Inherited from Product2[Double, Double]

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped