2D/3D Distance DLL

Blitz3D Forums/Blitz3D Userlibs/2D/3D Distance DLL

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.

Function Distance2D#(x1#,y1#,x2#,y2#)
	x#=x1#-x2#
	y#=y1#-y2#
	d#=Sqr#((x#*x#)+(y#*y#))
	Return d#
End Function

Function Distance3D#(x1#,y1#,z1#,x2#,y2#,z2#)
	x#=x1#-x2#
	y#=y1#-y2#
	z#=z1#-z2#
	d#=Sqr#((x#*x#)+(y#*y#)+(z#*z#))
	Return d#
End Function