How to locate a point in z axis given surface location x,y and z and the distance from the first point?

StackOverflow https://stackoverflow.com/questions/16770861

  •  30-05-2022
  •  | 
  •  

Question

I have location of a point P1 in x, y and z form. I want to find another point which is directly below this point (in z axis) at a distance d. This means that x & y co ordinates of P2 will be the same as that of P1. How to find the coordinates of P2 (z value)?

Was it helpful?

Solution

Maybe the most correct way would be to define a vector for the original point and one for the difference to the other point. Let a, b, c, represent the x, y, z coordinates for the known point and d is the distance of point 2 below point 1, then something like

v1 = {a, b, c}
diff = {0, 0, d}

and then subtract the two

v2 = v1 - diff

However, to merely get the coordinates of course all you really need to do is to define

v2 = {a, b, c-d}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top