updated

fun Point.updated(dX: Double, dY: Double): Point

Return

An instance of Point modified by the Double values dX and dY.

val a = pointOf(1, 2)
val dX = 2.0
val dY = 1.0
val b = a.updated(dX = dX, dY = dY)
assertEquals(b.x, a.x + dX)
assertEquals(b.y, a.y + dY)

Y
| b
3 - *
| a
2 - *
|
1 -
|
0 +---|---|---|---|---> X
0 1 2 3 4

Author

Stanley Wintergreen

Since

0.1.0


fun Point.updated(offset: Offset): Point

Return

An instance of Point modified by the offset.

val a = pointOf(1, 2)
val offset = offsetOf(2.0, 1.0)
val b = a.updated(offset)
assertEquals(b.x, a.x + offset.dX)
assertEquals(b.y, a.y + offset.dY)

Y
| b
3 - *
| a
2 - *
|
1 -
|
0 +---|---|---|---|---> X
0 1 2 3 4

Author

Stanley Wintergreen

Since

0.1.0

Sources

Link copied to clipboard
Link copied to clipboard