package net.iximeow.raytrace import Objects._ object Raymath { def angleBetween(a: Point, b: Point, c: Point): Double = { val lineA = a - b val lineB = c - b Math.acos(lineA.dot(lineB) / (lineA.magnitude * lineB.magnitude)) } def toDegrees(rad: Double): Double = rad * 360 / 2 / Math.PI def toRadians(deg: Double): Double = deg / 360 * 2 * Math.PI }