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): Polygon
  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): Sline

    Not sure about this method.

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

    The magnitude of this vector.

  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  39. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  40. def productArity: Int
    Definition Classes
    Product2 → Product
  41. def productElement(n: Int): Any
    Definition Classes
    Product2 → Product
    Annotations
    @throws(classOf[java.lang.IndexOutOfBoundsException])
  42. def productElementName(n: Int): String
    Definition Classes
    Product
  43. def productElementNames: Iterator[String]
    Definition Classes
    Product
  44. def productIterator: Iterator[Any]
    Definition Classes
    Product
  45. def productPrefix: String
    Definition Classes
    Product
  46. def prolign(m: ProlignMatrix): Vec2
    Annotations
    @inline()
  47. def reflect(lineSeg: Sline): Vec2

    Reflects or mirrors this across a line which is specified by two points on the line.

  48. def reflect(line: Line): Vec2

    Reflects or mirrors this across a line.

  49. def reflectX: Vec2

    Reflects ,mirrors along the X axis by negating Y.

  50. def reflectXLine(line: XLine): Vec2

    Reflects, mirrors this Vec2 across an XLine.

  51. def reflectXOffset(yOffset: Double): Vec2

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

  52. def reflectY: Vec2

    Reflects, mirrors along the Y axis by negating X.

  53. def reflectYLine(line: YLine): Vec2

    Reflects, mirrors this Vec2 across a YLine.

  54. def reflectYOffset(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

    This sure looks right

  56. def rotate180: Vec2

    Rotates the vector 180 degrees or Pi radians.

  57. def rotate270: Vec2

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

  58. def rotate90: Vec2

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

  59. def rotateRadians(r: Double): Vec2
  60. def scaleX(factor: Double): Vec2
  61. def scaleY(factor: Double): Vec2
  62. def str1: String
  63. def str2: String
  64. def str3: String
  65. def strMod(f: (Double) => String): String
  66. def subX(adj: Double): Vec2
  67. def subXY(otherX: Double, otherY: Double): Vec2
  68. def subY(adj: Double): Vec2
  69. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  70. 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

  71. def toPair: (Double, Double)
  72. def toString(): String
    Definition Classes
    Vec2 → AnyRef → Any
  73. def toTuple: (Double, Double)
  74. def unary_-: Vec2
  75. def vv(z: Double): Vec3
  76. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  77. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  78. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  79. val x: Double
  80. val y: Double

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