Find line of distance that ends on a ray

55 Views Asked by At

Here's the problem explained in a image:


Explaining the problem

I have point $P_0$ and $\vec V_A$, I want to find line that ends on $\vec V_A$ and is of length $d$.

2

There are 2 best solutions below

1
On BEST ANSWER

Assuming you know $P_3$, we want a point $$ P_3 + tv $$ to have distance $d$ from $P_0$, or, equivalently, to have squared distance $d^2$ from $P_0$. You'll "know" the point if you can find the number $t$. Writing that second version out, we seek a $t$ with the property that \begin{align} d^2 &= \|P_3 + tv - P_0 \|^2 \\ &= (P_3 + tv - P_0) \cdot (P_3 + tv - P_0) \\ &= (P_3-P_0 + tv) \cdot (P_3-P_0 + tv) \end{align} Now let's give a name to that repeated term: let $$ u = P_3 - P_0. $$ Then we seek a value of $t$ with \begin{align} d^2 &= (u + tv) \cdot (u + tv)\\ &= u \cdot u + 2 t u \cdot v + t^2 v \cdot v \end{align} so that \begin{align} t^2 (v \cdot v) + t (2 u \cdot v) + u \cdot u &= d^2 \\ t^2 (v \cdot v) + t (2 u \cdot v) + (u \cdot u - d^2) = 0. \end{align} That's a quadratic equation in the unknown $t$, and its solutions are \begin{align} t &= \frac{-2u \cdot v \pm \sqrt{4 (u \cdot v)^2 - 4(v \cdot v)(u \cdot u - d^2)}}{2 v \cdot v}\\ &= \frac{-u \cdot v \pm \sqrt{(u \cdot v)^2 - (v \cdot v)(u \cdot u - d^2)}}{v \cdot v}. \end{align}

Note that if $$(u \cdot v)^2 < (v \cdot v)(u \cdot u - d^2),$$ then there are no solutions (because the ray is too far from $P_0$). If those two are equal, then there's exactly one solution, providing the point at which the circle of radius $d$ about $P_0$ is tangent to the ray from $P_3$ in direction $v$.

1
On

Hint: Find the point $Q$ so that $P_0Q$ is perpendicular to $V_A$ and then use the Pythagorean theorem to find $P_1$.