Computer Science Canada

Math.Distance

Author:  Prognosis [ Sat Jan 21, 2006 7:46 pm ]
Post subject:  Math.Distance

Im making a program about lazer-sphere colision, and I think i need to use Math.Distance. only problem is that when i put it into turing, it says " 'Distance' is not in the export list of Math". Could someone please tell me why this isnt working.. i have version 4.04c
Thanks.

Author:  Rasta Fella [ Sat Jan 21, 2006 7:52 pm ]
Post subject: 

If I am correct Math.Distance is not supported in 4.04. That's the only thing I can think of according to your posted error.

Author:  Prognosis [ Sat Jan 21, 2006 7:55 pm ]
Post subject: 

ok, well i really wanna know how to do this then.

for example
say there is a dot and a oval on the screen going in random directions, how do I find out if this collide?

Author:  Delos [ Sat Jan 21, 2006 9:15 pm ]
Post subject: 

[sigh]. This is one of the reasons why using built in Functions without knowing how they work can mess people up. Math.Distance() is not a complicated piece of code. In fact, chances are that you already know exactly how to make it yourself, and if your version of Turing doesn't support it, then that's exactly what you'll be doing.
Math.Distance() is nothing more than Pythagorus' Theorem. Work along that method of thinking, and you'll have your problems solved in no time.

Additionally, check out the [Tuts] section on collision detection (Circular in particular) for furthur details.

Author:  Saad85 [ Sat Jan 21, 2006 9:36 pm ]
Post subject: 

heres the formula..

sqrt((x1-x2)**2+(y1-y2)**2)


: