Advertisement

Calculating distance between two 3D points

Started by February 11, 2002 03:00 PM
8 comments, last by nvdmerwe 23 years ago
I want to know how to calculate the distance between two 3D points. I know the method for 2D points but I''m thinking you''ll have to use the sin or cos rules for this one. Anyone? - code would be fantastic!
I''m pretty sure it''s just the small, but with the z-coordinate include:

sqrt( (x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2 )
Advertisement
It''s the extension of the 2D version:
distance2 = x2 + y2 + z2 


I wanna work for Microsoft!
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! ]
Thanks to Kylotan for the idea!
er, change ''small'' to ''same''
Thanks.

I thought it would be a lot more complex.
I apologize in advance cause it has nothing to do with math...
But I was very dissapointed to see on such a cool website someone having its signature as "I wanna work for Microsoft".
It is sad :`(
Advertisement
ROFL

My post up, your post down, my site here

quote:
Original post by Anonymous Poster
I apologize in advance cause it has nothing to do with math...
But I was very dissapointed to see on such a cool website someone having its signature as "I wanna work for Microsoft".
It is sad :`(


So what you are saying is that people that don''t hate Microsoft should not be on the is website? Interesting viewpoint.

There are special Microsofe-Hate websites for that kind of thing, but this is not one of them. Over here people with any viewpoint are allowed to post...

SS

SS
Mmm, Microsoft might have their own particular way of doing things but then so do many companies. They also pay excellent salaries, provide a great work environment, perform leading edge research and I believe, pay re-location costs if you need to move town/country for the job. That''s not a bad deal IMHO... so what if you have to unlearn your bad mistakes and learn a new set! ;-)

Cheers,

Timkin
Let he who has given Microsoft no money cast the first stone at he who wishes to take money from Microsoft :p See, I think people have it all wrong. It is giving money to Microsoft that is the problem, not taking money from Microsoft. If you want them to better service you as a customer then don''t reward them for not doing so.
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement