moved
Return
An instance of Point moved by the length and angle.
val a = pointOf(xN, yN)
val dX = xM - xN
val dY = yM - yN
val length = kotlin.math.sqrt(dX * dX + dY * dY)
val angle = kotlin.math.PI / 4
val b = a.updated(length = length, angle = angle)
assertEquals(b.x, a.x + dX)
assertEquals(b.y, a.y + dY)
Y
| b
yM - *
| /
| /
| a/ (kotlin.math.PI / 4)
yN - * - - - - - - - -
|
+---|---------|-----> X
xN xM
Content copied to clipboard
Author
Since
0.1.0