Construct 3D plane from 2 points and minimize angle of two vectors with its normal

94 Views Asked by At

I have as input two points $P, Q \in E^3$ and two vectors $\vec{v}_1, \vec{v}_2 \in R^3$. I need to construct a plane $(\vec{n}, d)$ such that the two points are in the plane and the angles between the plane normal and the two given vectors is minimal.

Directly using the vector $\vec{v}_1 + \vec{v}_2$ as the plane normal won't work, since we cannot ensure that this vector will be perpendicular to the vector $(P - Q)$.

I can construct a normal like this: $$ \vec{d} = P - Q \\ \vec{e} = \vec{v}_1 + \vec{v}_2 \\ \vec{f} = \vec{d} \times \vec{e} \\ \vec{n} = \vec{d} \times \vec{f} $$

Essentially, get the vector between the two given vectors $\vec{e}$. Find a vector $\vec{f}$ that is perpendicular to both $\vec{d}$ and $\vec{e}$. Find a normal for the plane containing $\vec{d}$ (this is a must, since both $P$ and $Q$ must lie in the plane) and $\vec{f}$.

At the moment, it seems to me that a problem can occur when $\vec{v}_1 = -\vec{v}_2$ and thus $\vec{e} = \vec{0}$. But if $\vec{v}_1 = \vec{v}_2$, it correctly computes the normal as $k\cdot\vec{v}_1$, where $k \in R$.

I really cannot even initially guess if this is the correct approach to construct it or not. My attempts at proving that there is no better vector failed.