Rotating a vector around an axis so that it falls onto the specified plane I'm trying to refactor/solve the following equation for theta if $ \vec{v} , \vec{r} $ and $ \vec{n} $ are known vectors:
$ \left(\vec{v} \cdot \cos\left(\theta\right) + \left(\vec{r} \times \vec{v}\right) \cdot \sin\left(\theta\right) + \vec{r} \cdot \left(\vec{r} \cdot \vec{v}\right) \cdot \left(1 - \cos\left(\theta\right)\right)\right) \cdot \vec{n} = 0 $
If this looks familiar, it's probably because it is - it's a combination of the Rodrigues equation for rotating a vector (in this case, $ \vec{v} \,$) around an axis $ \left(\vec{r} \right)$ and a simple dot operation to determine the distance of the resulting vector to a given plane defined by a normal $ \left(\vec{n}\right) $.
In essence, I'm trying to solve for $ \theta $ such that the vector $ \vec{v} $ will be rotated onto plane $ \vec{n} $ if possible. Near as I can tell, there should be either $ 0, 1 $ or $ 2 $ solutions to this problem - making me think that it might be possible to refactor this into something that can be solved by a quadratic equation.
Alternatively (and I have no idea how this would work) - I'm guessing it might also be possible to somehow "project" $ \vec{v} $ around the axis $ \vec{r} $ so that it falls on the plane with a normal defined by $ \vec{n} $ and then calculate the angle between the original vector and the projected vector $ \left(\vec{s}\right) $, but I'm not really sure how you would do that.
How can I solve this problem?

Starting from your equation $$\left(\vec{v} \cdot \cos\left(\theta\right) + \left(\vec{r} \times \vec{v}\right) \cdot \sin\left(\theta\right) + \vec{r} \cdot \left(\vec{r} \cdot \vec{v}\right) \cdot \left(1 - \cos\left(\theta\right)\right)\right) \cdot \vec{n} = 0$$ gives $$a \cos \theta - b \sin \theta = c,$$ where $a=\left(\vec{n} \cdot \vec{r} \right) \left(\vec{r} \cdot \vec{v}\right) - \vec{n} \cdot \vec{v}$, $b=\vec{n} \cdot \left(\vec{r} \times \vec{v}\right)$ and $c=\left(\vec{n} \cdot \vec{r} \right) \left(\vec{r} \cdot \vec{v}\right)$. Let $M=\sqrt{a^2+b^2}$ and $\alpha = \arctan \dfrac{b}{a}$; then $$M \cos \left(\theta + \alpha\right) = c,$$ which will give two values of $\theta$ if $|c| < |M|$, one if $|c| = |M|$ and none if $|c| > |M|$.
