typelevel / spire

Powerful new number types and numeric abstractions for Scala.
http://typelevel.org/spire/
MIT License
1.76k stars 242 forks source link

InnerProductSpace working example #1307

Closed MohammadForouhesh closed 6 months ago

MohammadForouhesh commented 6 months ago

We plan to use this wonderful library in one of our service, yet I couldn't find any proper tutorial on how to run a simple example. our use case is as follows: Lets say we have a case class Person, how can I calculate the dot product between two Person?

case class Person(age: Int, height: Int) 
val p = Person(20, 180)
val c = Person(15, 165)
p.dot(c)

If you provide me with some sample code, it would be highly appreciated.