dst2

open infix override fun dst2(vector: ImmutableVector2): Float

Returns the squared distance between this and the other vector

This method is faster than dst because it avoids calculating a square root. It is useful for comparisons, but not for getting exact distance, as the return value is the square of the actual distance.


fun dst2(otherX: Float, otherY: Float): Float

Returns the squared distance between this and the (otherX, otherY) vector

This method is faster than dst because it avoids calculating a square root. It is useful for comparisons, but not for getting exact distance, as the return value is the square of the actual distance.