to Vector
Return
An instance of Vector built from the this receiver as Vector.start and finish as Vector.finish.
val start = pointOf(1, 2)
val finish = pointOf(3, 4)
val vector = start.toVector(finish)
assertEquals(vector.start, start)
assertEquals(vector.finish, finish)
Content copied to clipboard
Author
Since
0.1.0
Return
An instance of Vector for which Vector.start is this receiver and Vector.finish is this receiver modified by the offset.
val start = pointOf(1, 2)
val offset = offsetOf(3.0, 4.0)
val vector = start.toVector(offset)
assertEquals(vector.start, start)
assertEquals(vector.finish, start.updated(offset))
Content copied to clipboard
Author
Since
0.1.0
See also
Return
An instance of Vector for which Vector.start is this receiver modified by the offset and Vector.finish is finish modified by the offset.
val start = pointOf(1, 2)
val finish = pointOf(3, 4)
val offset = offsetOf(5.0, 6.0)
val vector = start.toVector(finish, offset)
assertEquals(vector.start, start.updated(offset))
assertEquals(vector.finish, finish.updated(offset))
Content copied to clipboard
Author
Since
0.1.0
See also
Return
An instance of Vector for which Vector.start is this receiver and Vector.finish is this receiver moved by the length and angle.
val start = pointOf(1, 2)
val length = 3.0
val angle = 4.0
val vector = start.toVector(length = length, angle = angle)
assertEquals(vector.start, start)
assertEquals(vector.finish, start.moved(length = length, angle = angle))
Content copied to clipboard
Author
Since
0.1.0