In 2D space, how to calculate the direction to hit a moving projectile from a position? Imagine a 2D space. A is where our missile is, and B is where our target is currently moving with a velocity of $v_{2}$. B will come close to A in a certain time and then move away like a comet to earth. Our missile can travel at a speed of $s_{1}$, where the target speed is $|v_{2}|$. The  magnitude and direction of $v_{2}$ won't change. Similarly, for our missile, whose speed is constant, we need to calculate $v_{1}$ such that once the missile is launched, it will hit the moving target.
So we have $A$, $B$, $v_{2}$ and $s_{1}$. How can one find $v_{1}$ to hit the target?
The missile and target move with the equation
$$A = A + v_{1}\cdot\mathrm dt$$
$$B = B + v_{2}\cdot\mathrm dt$$
How do I calculate $v_{1}$?
 A: If I understood the question correctly, there is a point $\vec A_0$, from which a mass point is launched at time $t_0$ at some constant velocity $\vec v_1$ which should hit another mass point launched from $\vec B_0$ at the same time with velocity $\vec v_2$ and $v_1 := |\vec v_1|$ is known, but not the direction.
The trajectories can be parameterised as
$$
\vec A(t) = \vec A_0 + v_1t \begin{pmatrix} \cos(\theta) \\ \sin(\theta)\end{pmatrix}~, \qquad \vec B(t) = \vec B_0 + \vec v_2t~,
$$
then the problem is reduced to finding $t$ and $\theta$, such that $\vec A(t) = \vec B(t)$. Plugging in the parameterisation yields
$$
\vec A_0 + v_1t \begin{pmatrix} \cos(\theta) \\ \sin(\theta)\end{pmatrix} = \vec B_0 + \vec v_2t \qquad \Leftrightarrow \qquad \vec A_0 - \vec B_0 = \vec v_2 t - v_1 t \begin{pmatrix} \cos(\theta) \\ \sin(\theta)\end{pmatrix}
$$
$$
\Leftrightarrow A_{0x} - B_{0x} = v_{2x} t - v_1 t \cos(\theta)~,~ A_{0y} - B_{0y} = v_{2y}t - v_1t\sin(\theta)~.
$$
$$
\Rightarrow \frac{A_{0x} - B_{0x}}{v_{2x} - v_1\cos(\theta)} = t~.
$$
$$
\Rightarrow A_{0y} - B_{0y} = v_{2y} \frac{A_{0x} - B_{0x}}{v_{2x} - v_1\cos(\theta)} - v_1 \frac{A_{0x} - B_{0x}}{v_{2x} - v_1\cos(\theta)} \sin(\theta)~.
$$
$$
\Rightarrow (A_{0y} - B_{0y}) (v_{2x} - v_1 \cos(\theta)) = (A_{0x} - B_{0x}) (v_{2y} - v_1 \sin(\theta))~.
$$
This equation is a little nasty, and to my knowledge not solvable directly for $\theta$. However, $\theta$ can only be in $[0,2\pi)$, so it should be fairly easy to solve this numerically for given $\vec A_0,\vec B_0,v_1,\vec v_2$. As soon as you have a solution for $\theta$,
$$
\vec v_1 = v_1 t\begin{pmatrix} \cos(\theta) \\ \sin(\theta)\end{pmatrix}
$$
should give you what you called $v_1$.
Remark: Sorry for not using the symbols you suggested, but I needed to distinguish between $\vec v_1$ and $v_1 := |\vec v_1|$ as well as between $\vec A(t),\vec B(t)$ and $\vec A_0,\vec B_0$ for my calculation.
A: So we have $\vec A, \vec B, \vec v_2$ and $|\vec{v_1}| = s_1$. We can represent the vector $\vec{v_1}$ as follows:
$$
\vec d = \vec B - \vec A \\
\vec B + \vec v _2 t = \vec A + \vec v _1 t \\
\vec v_1 = \frac{\vec d  + \vec v_2t}{t} \\
\vec v_1 ^2 = |\vec v_1|^2 = v_1^2= s_1^2\\
$$
Where t is the time after which the collision will take place. We can calculate time by squaring this expression:
$$
\vec d + \vec v _2 t = \vec v _1 t  \\
d ^{2} + 2 (\vec v _2 \cdot \vec d)t + v_2^2t^2 = s_1^2t^2 \\
(v_2^2 - s_1^2)t^2 + 2(\vec v_2 \cdot \vec d)t + d^2 = 0
$$
Solve the quadratic equation for t > 0.
