simple geometry
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
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)
sqrt((x1 - x2)^2 + (y1 - y2)^2)
And in 3D it is just
sqrt((x1 - x2)^2 + (y1 - y2)^2 + (z1 - z2)^2)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement