Given an initial vector \$\vec b\$ of arbitrary length, we can calculate two scale factors that will bring it to the same horizontal or vertical offset as our reference vector \$\vec a\$:
$$s_x = \frac {a_x} {b_x}\\
s_y = \frac {a_y} {b_y}$$
Choose \$s_x\$ if you want both vectors to arrive at the same vertical line (same horizontal offset), or \$s_y\$ if you want both vectors to arrive at the same horizontal line. Or you could select whichever of the two is the finite positive number closest to zero, breaking ties arbitrarily.
Let's say I choose \$s_x\$, then my new modified vector is:
$$\vec b^\prime\ = s_x \vec b\ = \begin{bmatrix}s_x b_x\\ s_x b_y\end{bmatrix}= \begin{bmatrix}\frac{a_x}{b_x} b_x\\ \frac{a_x}{b_x} b_y\end{bmatrix}=\begin{bmatrix}a_x\\ \frac{a_x}{b_x} b_y\end{bmatrix}$$
The magnitude of this vector is just:
$$||\vec b ^\prime|| = s_x ||\vec b||$$