Given any two lines in space, find a third line that makes given angles with the first two

52 Views Asked by At

Given the two lines

$ p(t) = p_0 + t v_1 $

$ q(s) = q_0 + s v_2 $

I want to find a third line $ r(w) $ that intersects these two at given angles $\theta_1$ and $\theta_2$ respectively.

My approach: Since the third line has to intersect the given two lines, then take a point on each, and calculate the vector between them, and impose that angle condition.

The vector from a point on the first line to a point on the second line is

$ V(t, s) = q_0 - p_0 + s v_2 - t v_1 $

The angle conditions, using the dot product, and assuming $v_1$ and $v_2$ are unit vectors, mean that

$ \cos( \theta_1 ) = (V \cdot v_1) / | V | $

$ \cos( \theta_2 ) = ( V \cdot v_2 ) / | V | $

Squaring these equations and cross multiplying gives

$ | V |^2 \cos^2 (\theta_1) = ( V \cdot v_1 )^2 $

$ | V |^2 \cos^2 (\theta_2) = ( V \cdot v_2 )^2 $

Using the expression for $V$ will transform the two last equations into two quadratic equations in $t$ and $s$. These two quadratic equations can be solved numerically and will give a number of solutions ranging from $0$ to $4$.

Having obtained $t$ and $s$, we now have two points lying on the third line so its parametric equation can be obtained for each pair $(t, s)$ that solves the quadratic system of equations.

I've verified this numerically.

Your comments, hints, or alternative solutions are highly appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

Assuming $v_1,v_2$ are not linearly dependent (otherwise it is just 2D geometry --- there are infinitely many solutions if $\theta_1=\theta_2$ only the direction of the line is fixed not the intersection, and no solution for $\theta_1\neq\theta_2$.)

First we obtain closest points $P=p(t_0)$, $Q=q(s_0)$ and $\overrightarrow{PQ}\perp\langle v_1,v_2\rangle$ by solving pair of linear equations $(p(t)-q(s))\cdot v_i=0$. If $P=Q$ this reduce to 2D geometry which we know how to solve and again there are infinitely many solutions because similar triangles. Also if $\theta_1=\theta_2=\frac\pi2$ then we are done.

So assume $s_0=t_0=0$ and $\theta_1,\theta_2$ are not both $\frac\pi2$. Also assume $v_1,v_2$ unit vectors with angle $\phi$ between them, so we need to solve \begin{align*} [(PQ)^2+(s^2+t^2-2st\cos\phi)]\cos^2\theta_1&=(-t+s \cos\phi)^2\\ [(PQ)^2+(s^2+t^2-2st\cos\phi)]\cos^2\theta_2&=(-t\cos\phi+s)^2 \end{align*} so first solve for the ratio $s:t$ by having $$ (-t+s\cos\phi)^2\cos^2\theta_2=(-t\cos\phi+s)^2\cos^2\theta_1 $$ i.e. $s:t=(\cos\theta_1\cos\phi-\cos\theta_2):(\cos\theta_1-\cos\theta_2\cos\phi)$ or $s:t=(\cos\theta_1\cos\phi+\cos\theta_2):(\cos\theta_2\cos\phi+\cos\theta_1)$. and then solve the quadratic for $s$ (or $t$) analytically.