closestPoint

fun closestPoint(reference: Vector2, points: Array<Vector2>): Vector2

A function to find the closes vector2 (relative to a reference vector2) in an array of vector2s

Return

The closest vector2

Parameters

reference

The reference vector2

points

The array of vector2s