PDA

View Full Version : how to calculate the way between 2 Points?



MofuX
11-29-2001, 07:51 AM
hi, i want to make a waypoint system... so i need some calculation stuff how to calculate this:

^ z
|创创创创创. P2 (x,z)
|创创创. P1 (x,z)
|
|___________________>x


ok, I want that my bot is travalling from P1 to P2... i've tryed to get the angle beetween them but something doesn't work...
could anybody post some Code please?
don't look at the they are only because this forum doesnt accept Tabs
Thanks!!!

[This message has been edited by MofuX (edited 11-29-2001).]

grady
11-29-2001, 08:14 AM
The line from P1 to P2 is (x,y) = (1-t)P1 + t*P2 where t:[0,1]

[This message has been edited by grady (edited 11-29-2001).]

11-29-2001, 11:32 AM
Here is some docs that migth come into handy: http://www.geocities.com/pcgpe/math2d.html http://www.geocities.com/pcgpe/math3d.html

I found the links earlier in some forum here.