# How much should I scale $dx$ and $dy$ individually to get a vector of required magnitude

I have a $dx$ and a $dy$ and I need to create a vector of magnitude $35.5$ in that $(dx, dy)$ direction. How much should I scale $dx$ and $dy$?

Scale by $35.5 / \sqrt{dx^2 + dy^2}$.

Example: if $dx = 1$ and $dy = 2$, then the denominator is $\sqrt{5} \approx 2.236$, so you'd multiply each of $dx$ and $dy$ by $35.5/2.236 \approx 15.88$ to get approximately $$[15.88, 31.75]$$ as your new vector.

The length of the original vector will be $\sqrt{dx^2+dy^2}$, which I call $L$. Suppose you want the vector to be of length $M$.

Then you need to scale the components by $\dfrac{M}{L}$.

Example. Suppose you have $dx=3$ and $dy=-4$ and you want the vector to have length $M=10$.

The length of the vector currently is $L=\sqrt{3^2+(-4)^2}=5$. Thus, we need to scale them components by $\dfrac{10}{5}=2$.

The new vector would be $dx'=3\times2=6$ and $dy'=-4\times2=-8$.

So you get basically...: $\vec{v} = dx\vec{i} + dy\vec{j}$ , and $||\vec{v}|| = \sqrt{(dx)^2+(dy)^2} = 35.5$. Now let $dx = kdx', dy = kdy'$, then $k = 35.5$, and that $\vec{v'} = dx'\vec{i} + dy'\vec{j}$ is the unit vector in the direction of $\vec{v}$, and $||\vec{v'}|| = 1$