if your first point is vector3df(rpx1,rpy1,rpz1)
and your second point is vector3df(rpx2,rpy2,rpz2)
sqrt(((rpx1-rpx2)^2)+((rpy1-rpy2)^2)+((rpz1-rpz2)^2)));
will this resolve the distance between the two points.
(rustrated edit)
this seems odd i though ^2 was to squar a number it is xor function. It took me some time to figure that out not that great in C. But here is the new c friendly math.
delta = sqrt((pow((rpx1-rpx2),2))+(pow((rpy1-rpy2),2))+(pow((rpz1-rpz2),2)));
it seems to work i plug in some obvious numbers and i get a distance you would expect.
0,0,10
0,0,1
you get a number close just a hair over 9.
distance between two points in 3d space
Ya im writing a tool that will not load the engine so i had to do the math.
Anywhay its the best whay to understand stuff. I usally try to go back and do the math of most stuff i can get my mind around just so i understand what went wrong when it screws up.
Thanks guys
btw is that the only way to square a number is do the pow(int,2);
Anywhay its the best whay to understand stuff. I usally try to go back and do the math of most stuff i can get my mind around just so i understand what went wrong when it screws up.
Thanks guys
btw is that the only way to square a number is do the pow(int,2);