To find the angle, I guess you have to use trig. Try this formula...
x_dif#=object position x(obj1)-object position x(obj2)
z_dif#=object position z(obj1)-object position z(obj2)
y_angle#=atan(x_dif#/z_dif#)
To find the distance between the objects you use pythagorus' theorum...
ON 2 DIMENSIONS (a plane)
z^2 = y^2+x^2
or
z = sqrt(y^2+x^2)
ON 3 DIMENSIONS
z^2 = y^2+x^2+w^2
or
z = sqrt(y^2+x^2+w^2)
where...
z = the dist between the two points
w, x and y = the difference (distance) between the x,y and z coordinates of the objects.
Why the hell'd you ask me for crying out loud!?!
Athelon XP 1400 Plus - Nvidia Geforce MX400 - 256mb RAM