Page 1 of 1

Math.Distance[Y1,X1,Y2,X2] bug

Posted: Wed Apr 06, 2005 4:45 am
by Jon100
There seems to be a bug in the maths of the Math.Distance function.

Code: Select all

/echo ${Math.Distance[0,0,100,100]}
should return 141.42 (the distance from 0,0 to 100,100) but gives some wildly wrong numbers which change as you move around.

Code: Select all

/echo  ${Math.Distance[0,0]}
works correctly though (the distance from Me to 0,0).


MQ2-20050328

Jon100

Posted: Wed Apr 06, 2005 4:52 am
by Lax
Actually that's just a result of incorrect usage.

It's Math.Distance[loc:loc] where each loc may consist of up to 3 dimensions

The way you're using it is equivalent to Math.Distance[0,0,100] -- the 4th will be ignored, and that will be the distance from Me to 0,0,100.