⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

Vec2.Distance

static float Distance(Vec2 a, Vec2 b)

Calculates the distance between two points in space! Make sure they’re in the same coordinate space! Uses a Sqrt, so it’s not blazing fast, prefer DistanceSq when possible.

   
Vec2 a The first point.
Vec2 b And the second point!
RETURNS: float Distance between the two points.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!