Packages

case class Vec(x: Double, y: Double, z: Double) extends Vertex with Product with Serializable

a 2d or 3d point in space

Source
vec.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Vec
  2. Serializable
  3. Product
  4. Equals
  5. Vertex
  6. AnyRef
  7. Any
Implicitly
  1. by richDrxAny
  2. by DrxBoundOps
  3. by any2stringadd
  4. by StringFormat
  5. by Ensuring
  6. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Vec(x: Double, y: Double, z: Double)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def *(s: Double): Vec

    scalar multiplication

  4. def *(that: Vec): Double

    dot product

  5. def +(that: Vec): Vec
  6. def +-(that: Vec): Line
  7. def -(that: Vec): Vec
  8. def ->[B](y: B): (Vec, B)
    Implicit
    This member is added by an implicit conversion from Vec toArrowAssoc[Vec] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  9. def /(s: Double): Vec

    scalar division

  10. def :*(that: Vec): Vec

    element wise multiplication

  11. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def a: Double
  13. def angle(a: Angle): Vec

    keep the magnitude but use a new angle (in the x,y axis)

  14. def angleBetween(that: Vec): Angle

    the smallest angle between two vectors

  15. def applyIf(t: Boolean, f: (Vec) => Vec): Vec
    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  16. def applyIf(t: (Vec) => Boolean)(f: (Vec) => Vec): Vec

    better chaining for types

    better chaining for types

    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  17. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  18. def b: Double
  19. def c: Double
  20. def ceil: Vec
  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  22. def colinear(a: Vec, b: Vec): Boolean
  23. lazy val cos: Double
  24. def d: Double
  25. def dependent(that: Vec): Boolean

    colinear in 3d

  26. def dist(that: Vec): Double

    euclidean distance

  27. def dist2(that: Vec): Double
  28. def e: Double
  29. def elementOf(xs: Set[Vec]): Boolean
    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  30. def ensuring(cond: (Vec) => Boolean, msg: => Any): Vec
    Implicit
    This member is added by an implicit conversion from Vec toEnsuring[Vec] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  31. def ensuring(cond: (Vec) => Boolean): Vec
    Implicit
    This member is added by an implicit conversion from Vec toEnsuring[Vec] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  32. def ensuring(cond: Boolean, msg: => Any): Vec
    Implicit
    This member is added by an implicit conversion from Vec toEnsuring[Vec] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  33. def ensuring(cond: Boolean): Vec
    Implicit
    This member is added by an implicit conversion from Vec toEnsuring[Vec] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  34. def eps: Double
  35. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  37. def floor: Vec
  38. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Vec toStringFormat[Vec] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  39. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  40. lazy val heading: Angle

    heading assuming a xyz => ned direction, or Cartesian chalk board: x->right, y->up, z->out of board

  41. def headingDelta(that: Vec): Angle
  42. def is2d: Boolean
  43. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  44. def last: Vec
    Definition Classes
    VecVertex
  45. def lerp(that: Vec)(amt: Double): Vec

    linear interpolation (Euclidean)

  46. def lineTo(that: Vec): Line
  47. def mag(m: Double): Vec

    keep the angle but use a new magnitude

  48. def map(f: (Double) => Double): Vec

    Collections like map func

  49. def max: Double
  50. def min: Double
  51. def mx(a: Double): Vec

    Move/set the x value

  52. def my(a: Double): Vec

    Move/set the y value

  53. def mz(a: Double): Vec

    Move/set the z value

  54. def n: Double
  55. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  56. def noneIf(f: (Vec) => Boolean): Option[Vec]
    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  57. lazy val norm: Double

    norm |v|

  58. lazy val normSq: Double
  59. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  60. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  61. def optionIf(f: (Vec) => Boolean): Option[Vec]

    optionally wrap an object

    optionally wrap an object

    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  62. def p: Double
  63. def point(that: Vec)(func: (Double, Double) => Double): Vec

    pointwise operations ex: a point b {_ max _}

  64. def preApply[B](f: (Vec) => B): B

    a preApply f => f(a)

    a preApply f => f(a)

    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  65. def productElementNames: Iterator[String]
    Definition Classes
    Product
  66. def projOn(that: Vec): Vec
  67. def q: Double
  68. def r: Double
  69. lazy val range: Double
  70. def round: Vec
  71. def rx(a: Angle): Vec

    Rotate around the x axis

  72. def ry(a: Angle): Vec

    Rotate around the y axis

  73. def rz(a: Angle): Vec

    Rotate around the z axis

  74. def rzAt(a: Angle, pivot: Vec): Vec

    Rotate around the z axis relative to a point i.e 1) translate pivot point *at* to origin 2) apply rotation *at* vec 3) shift *to* a new location

  75. def rzLeft: Vec

    Rotate by a negative right Angle around the z axis (no trig)

  76. def rzRight: Vec

    Rotate by a right Angle around the z axis (no trig)

  77. def rzTo(a: Angle, pivot: Vec, to: Vec): Vec

    Rotate around the z axis relative to a point and then move(translate) to a new point i.e 1) translate pivot point *at* to origin 2) apply rotation *at* vec 3) shift *to* a new location

  78. def sat(max: Double): Vec
  79. def sat(min: Double, max: Double): Vec
  80. def segmentFrom(that: Vec): Line
    Definition Classes
    VecVertex
  81. def sideEffect(f: (Vec) => Unit): Vec

    side effect filter

    side effect filter

    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  82. lazy val sin: Double
  83. def slerp(that: Vec)(amt: Double): Vec

    spherical interpolation (great circle) wikipedia://Slerp

  84. def someIf(f: (Vec) => Boolean): Option[Vec]
    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  85. def sq: Vec

    element wise square

  86. def swap: Vec

    swap the x and y values

  87. def sx(a: Double): Vec

    Scale the x axis

  88. def sy(a: Double): Vec

    Scale the y axis

  89. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  90. def sz(a: Double): Vec

    Scale the z axis

  91. lazy val tan: Double
  92. val thisAny: Vec
    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
  93. def till(maxArg: Vec): Bound[Vec]

    Bound construction since the Range constructor is deprecated

    Bound construction since the Range constructor is deprecated

    Implicit
    This member is added by an implicit conversion from Vec toBoundOps[Vec] performed by method DrxBoundOps in cc.drx.predef.Enrich.
    Definition Classes
    BoundOps
  94. def toArray: Array[Double]
  95. def toComplex: Complex
  96. def toPair: (Double, Double)
  97. def toTuple: (Double, Double, Double)
  98. def toVector: Vector[Double]
  99. def tx(a: Double): Vec

    Translate in the x axis

  100. def ty(a: Double): Vec

    Translate in the y axis

  101. def tz(a: Double): Vec

    Translate in the z axis

  102. def u: Double
  103. def unary_-: Vec

    negate the vector

  104. lazy val unit: Vec

    v/|v|

  105. def v: Double
  106. def w: Double
  107. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  108. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  109. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  110. def x(that: Vec): Vec

    cross product

  111. val x: Double
  112. def x2d(that: Vec): Double
  113. def xx: Double
  114. val y: Double
  115. def yy: Double
  116. val z: Double
  117. def zz: Double
  118. def ~(that: Vec): Line
  119. def ~(r: Double): Circ
  120. def ~>(that: Vec): Line
  121. def θ: Double
  122. def φ: Double
  123. def ψ: Double

Shadowed Implicit Value Members

  1. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Vec toany2stringadd[Vec] performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (vec: any2stringadd[Vec]).+(other)
    Definition Classes
    any2stringadd

Deprecated Value Members

  1. def ?>(f: (Vec) => Boolean): Option[Vec]

    alias for option if

    alias for option if

    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
    Annotations
    @deprecated
    Deprecated

    (Since version v0.2.15) to many symbols are hard to undertand

  2. lazy val deg: Double
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.0-angle) use the more direct heading.deg

  3. lazy val degPos: Double
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.0-angle) use the more direct heading.pos.deg

  4. lazy val norm2: Double

    norm squared (useful for calculations that do not need the square root operation)

    norm squared (useful for calculations that do not need the square root operation)

    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.13) use normSq instead

  5. lazy val rad: Double
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.0-angle) use the more direct heading.rad

  6. lazy val radPos: Double
    Annotations
    @deprecated
    Deprecated

    (Since version 0.2.0-angle) use the more direct heading.pos.rad

  7. def |>[B](f: (Vec) => B): B
    Implicit
    This member is added by an implicit conversion from Vec toDrxAny[Vec] performed by method richDrxAny in cc.drx.predef.Enrich.
    Definition Classes
    DrxAny
    Annotations
    @deprecated
    Deprecated

    (Since version v0.2.15) use preApply if you must (symbols are concise without concision)

  8. def ~(string: String): Text
    Annotations
    @deprecated
    Deprecated

    (Since version v0.1.20) use string ~ vec vec instead (higher priority to the string)

  9. def [B](y: B): (Vec, B)
    Implicit
    This member is added by an implicit conversion from Vec toArrowAssoc[Vec] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Vertex

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion richDrxAny fromVec to DrxAny[Vec]

Inherited by implicit conversion DrxBoundOps fromVec to BoundOps[Vec]

Inherited by implicit conversion any2stringadd fromVec to any2stringadd[Vec]

Inherited by implicit conversion StringFormat fromVec to StringFormat[Vec]

Inherited by implicit conversion Ensuring fromVec to Ensuring[Vec]

Inherited by implicit conversion ArrowAssoc fromVec to ArrowAssoc[Vec]

Ungrouped