How to calculate the distance between two 7in 3D
How to calculate the distance between two in 3D (x1,y1,z1) & (x2,y2,z2) ??
Sorry about my math, I know how to do it in 2D, is it the same
??
Can I use vector operation (dot, cross, multiply) to do it ??
what exactly does dot, cross, mul mean (I mean how to implement in solving problem)??
Thanks
Ride the thrill of your life
Play Motorama
Play Motorama
If I''m not mistaken, you can use this:
Distance = sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)
Distance = sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)
I am always open to feedback, positive or negative...
correct.
subtracting one point from the other gives you a vector that is the length of the distance between the points.
then you use basically 3D pythagorean theorem as per the equation above.
-me
subtracting one point from the other gives you a vector that is the length of the distance between the points.
then you use basically 3D pythagorean theorem as per the equation above.
-me
Hmm.. assuming that I have 2 bounding circles .. errr.. balls with radius r1 and r2..
how can I check if those two collided or not ?
The idea is =
if (sqr(x1-x2)+sqr(y1-y2)+sqr(z1-z2) < sqr(r1)+sqr(r2)) then
collided
else
not collided
??? is it true ?? Can somebody explain the theory behind those equation ??
how can I check if those two collided or not ?
The idea is =
if (sqr(x1-x2)+sqr(y1-y2)+sqr(z1-z2) < sqr(r1)+sqr(r2)) then
collided
else
not collided
??? is it true ?? Can somebody explain the theory behind those equation ??
Ride the thrill of your life
Play Motorama
Play Motorama
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement