• Advertisement
Sign in to follow this  

simple geometry

This topic is 4375 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, im feeling embarassed asking such a simple question but it has been a long time since I did maths in college. I'm developing a program, for which I have to calculate the length between 2 objects. I have tried: x1 - x2; y1 - y2; but this results in another set of co-ordinates and I need a single value that gives the distance between these 2 objects. If anybody understands what I'm saying and has the solution it would be a great help. thanx

Share this post


Link to post
Share on other sites
Advertisement
The distance will be

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

And in 3D it is just

sqrt((x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement