At a particular moment in time the Moon is located $\langle 1.9\times10^8, 0, -1.9\times10^8 \rangle$ m in a coordinate system in which the origin is located at the center of the Earth.
Determine the gravitational force exerted by the Earth on the Moon.
In order to find the gravitational force we must first calculate the center to center distance between the moon and the earth
$$|\vec{r}_{M-E}| = \sqrt{(r_{M-E_x})^2+(r_{M-E_y})^2+(r_{M-E_z})^2}$$
$$ = \sqrt{(1.9 \times 10^8 m)^2 + (0m)^2 + (-1.9 \times 10^8 m)^2}$$
$$ = 2.7 x 10^8 m$$
We also must find the direction of this force. The direction of the force will be in the same direction as the radius vector. We can find the direction of a vector by computing the unit vector of $\vec{r}_{M-E}$
$$ \hat{r}_{M-E} = \dfrac{\vec{r}_{M-E}}{|\vec{r}_{M-E}|} $$
$$ = \dfrac{\langle 1.9 \times 10^8, 0, -1.9 \times 10^8 \rangle m}{2.7 \times 10^8 m}$$
$$ = \langle 0.7,0,-0.7 \rangle$$
Adding both the direction of the radius and the length of the radius to the mass of the Earth and the mass of the Moon and the gravitational constant we now have all of the variables needed to compute the gravitational force exerted by the Earth on the Moon. The force between the Earth and the moon is the same as the gravitational force exerted by the Earth on the Moon.
$$ \vec{F}_{M-E} = \vec{F}_{grav\,on\,M\,by\,E}$$ This is the representation we identified for gravitational force. There is a minus in front of the G as the direction of the gravitational force is opposite to the direction of the unit vector $\hat{r}$, which points from object 1 (Moon) to object 2(Earth).
$$ = -G\dfrac{{m}_M{m}_E}{|\vec{r}_{M-E}|^2}\hat{r}_{M-E}$$ Input all the values identified for the various variables.
$$ = (6.7 \times 10^{-11} Nm^2/kg^2)\dfrac{(7.3 \times 10^{22} kg)(5.9 \times 10^{24} kg)}{(2.7 \times 10^8 m)^2}\langle -0.7,0,+0.7 \rangle$$
Results in the magnitude of the force by unit vector (direction).
$$ = 4.0 \times 10^{20}N \langle -0.7,0,+0.7 \rangle$$
Results in the vector force, with the x,y,z components interpretable.
$$ = \langle -2.8 \times 10^{20}, 0, 2.8 \times 10^{20} \rangle N $$