fromList

fun fromList(list: List<Int>): Vec2<Int>
fun fromList(list: List<Long>): Vec2<Long>

Returns an instance of Vec2 with the given list of coordinates.

If the size of the list of coordinates is different from 2, IllegalArgumentException is thrown.

Since

v2.0.0


fun fromList(list: List<Float>): Vec2<Float>

Returns an instance of Vec2 with the given list of coordinates.

If the size of the list of coordinates is different from 2, IllegalArgumentException is thrown.