Point coordinates at a fixed distance from a vector

417 Views Asked by At

I would like to solve the following generic problem by using vector notation that I will use it to improve my algorithm.

I have a vector P1P2 that points P1 and P2 are known. Furthermore, an arbitrary point P(xp,yp) and perpendicular distance from point A and P, d=|AP| is known. The only unknown is the point A(xa,ya).

By using the distance formula and solving for A should solve the problem geometrically, but the question is how this can be done by using vectors? In addition, I know that there will be two solutions, one on LHS and one on RHS of the vector, I would like to be able to include both cases as well.

Thanks for your replies in advance!

enter image description here

1

There are 1 best solutions below

5
On BEST ANSWER

I'm assuming you're in the plane. If so: \begin{align} \mathbf s = P_2 - P_1\\ \mathbf u = \frac{\mathbf s}{\| \mathbf s \|} \\ \mathbf v = d \begin{bmatrix} -u_y \\ u_x\end{bmatrix}\\ A = P + \mathbf v \end{align}

Here $u_x$ and $u_y$ denote the components of the vector $\mathbf u$.

Details: I'm assuming you're willing to add a vector to a point to get a new vector, and subtract two points to get a vector. I like to think of vectors as "displacements," in which case those two operations make a lot of sense.

The only subtle operation is turning a vector $\begin{bmatrix} p \\q\end{bmatrix}$ into the vector $\begin{bmatrix} -q \\p\end{bmatrix}$, which rotates it 90 degrees counterclockwise. You can think of this as a 2D cross product (which takes only one argument, not two), so that $\mathbf v, \times \mathbf v$ is, for any nonzero vector $\mathbf v$, a positively oriented basis of $\mathbb R^2$, just as $\mathbf v, \mathbf w, v\times \mathbf w$ is a positively oriented basis for $\mathbb R^3$ for two independent vectors in 3-space.