Distance between two points in 3d.

Blitz3D Forums/Blitz3D Programming/Distance between two points in 3d.

Function DISTANCE3D#(x1#,y1#,z1#,x2#,y2#,z2#)
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; USE EUCLIDEAN DISTANCE (3D) TO WORK OUT THE DISTANCE TWO ENTITIES ARE FROM EACH OTHER
; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

DISTANCE#=Sqr((X2-X1)^2+(Y2-Y1)^2+(Z2-Z1)^2)

Return DISTANCE
End Function


Should do the trick