Computer Science Canada

finding the distance

Author:  Chaos_Theory [ Thu Apr 21, 2005 5:42 pm ]
Post subject:  finding the distance

how do you find the distance between to object that randomly appear somewhere on the screen?

Author:  Tony [ Thu Apr 21, 2005 5:45 pm ]
Post subject: 

Turing:

Math.Distance(x1,y1,x2,y2)

perhaps?

Author:  Chaos_Theory [ Thu Apr 21, 2005 5:47 pm ]
Post subject: 

Tony wrote:
Turing:

Math.Distance(x1,y1,x2,y2)

perhaps?


I tired that already.. and it says that distance is not a part of math

Author:  36002 [ Thu Apr 21, 2005 6:37 pm ]
Post subject: 

You might have an older version of Turing. Try this:
code:

d := ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** .5 %this gets the distance between two points

simple math Very Happy

Author:  Chaos_Theory [ Thu Apr 21, 2005 8:48 pm ]
Post subject: 

36002 wrote:
You might have an older version of Turing. Try this:
code:

d := ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** .5 %this gets the distance between two points

simple math Very Happy


thnx... now my program is pretty much complete...just a lil but of minor tweakig


: