distance between two points

BlitzMax Forums/BlitzMax Beginners Area/distance between two points

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

That looks right to me.

Function Vec2DDistance:Double(v1:Vector2D, v2:Vector2D)
Local ySeparation:Double = v2.y - v1.y
Local xSeparation:Double = v2.x - v1.x
Return Sqr(ySeparation*ySeparation + xSeparation*xSeparation)
End Function