Skip to content

Instantly share code, notes, and snippets.

@ruurtjan
Created July 13, 2018 07:48
Show Gist options
  • Save ruurtjan/a24077bc364f693d1283c76d200257ac to your computer and use it in GitHub Desktop.
Save ruurtjan/a24077bc364f693d1283c76d200257ac to your computer and use it in GitHub Desktop.
Learning linear algebra with Scala - vector implicits sample
import MatrixImplicits._
import model.{Matrix2, Vector2}
object VectorImplicits {
implicit class ArithmeticVectorImplicits(v: Vector2) {
def +(v2: Vector2): Vector2 = ???
def *(scalar: Float): Vector2 = ???
def *(m: Matrix2): Vector2 = ???
def isLinearlyDependent(v2: Vector2): Boolean = ???
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment