Say I have a two-dimensional vector v, which is the velocity of a rocket. I also have the vector f, which is a direction vector (with magnitude 1), that represents the direction the rocket is facing.
Given that I know f and v, how can I determine the speed the rocket is traveling along f? In other words, if f = v, the answer would be the magnitude of v. If f is perpendicular to v, the answer would be zero. How can I get the answer for arbitrary f and v, in basic algebraic terms?
This seems to be a duplicate, but I honestly can't tell. I don't have a solid understanding of any more than basic algebra and a few essential concepts of trigonometry. Can someone explain how solve this problem without assuming more than a grade-school level of mathematics?
What you want is the vector dot product between $f$ and $v$:-
$speed=|v||f|\cos(\theta)=v\cdot f$
where $\theta$ is the angle between vectors $v$ and $f$, and $|v|$ and $|f|$ are the magnitude of vectors $v$ and $f$ respectively.
Note that if the vectors are perpendicular, $\theta=\pi/2$, so that $\cos(\theta)=0$, resulting in zero speed. If, however, $f$ and $v$ coincide, then $\theta=0$, leading to $\cos(\theta)=1$, so that the speed is $|v|$, the magnitude of $v$, as $|f|$ is equal to $1$.
If we represent the vectors in the following manner (assuming a $3$-D system of coordinates):-
$$v=v_x\mathbf{x}+v_y\mathbf{y}+v_z\mathbf{z}$$
$$f=f_x\mathbf{x}+f_y\mathbf{y}+f_z\mathbf{z}$$
The magnitude of the vectors will be:-
$$|v|=\sqrt{v_x^2+v_y^2+v_z^2}$$
$$|f|=\sqrt{f_x^2+f_y^2+f_z^2}=1$$
The dot product is given by
$$v\cdot f=v_xf_x+v_yf_y+v_zf_z=|v||f|\cos(\theta)$$
Thus
$$\cos(\theta)=\frac{v\cdot f}{|v||f|}=\frac{v_xf_x+v_yf_y+v_zf_z}{\sqrt{v_x^2+v_y^2+v_z^2}}$$