Displacement Vector in Three Dimensions
We previously defined the displacement vector of a point moving on the $x$-axis as
\boxed{\mathrm{\Delta }\overrightarrow{r}={\overrightarrow{r}}_f-{\overrightarrow{r}}_i=\left(x_f-x_i\right)\ \hat{x}}
The displacement vector being the difference of the final position vector $\overrightarrow{r_f}$ and the initial position vector $\overrightarrow{r_i}$, we generalize the idea of displacement to a two-dimensional and a three-dimensional displacement by using a two-dimensional position vector and a three-dimensional position vector respectively.
Displacement vector in a 2D coordinate system:
Consider a particle with initial and final position vectors shown in the figure below and defined by
{\overrightarrow{r}}_i=\left\langle x_i,y_i\right\rangle \ \ \ and \ \ \ {\overrightarrow{r}}_f=\left\langle x_f,\ y_f\right\rangle
The displacement vector of a point moving in the $xy$-plane is equal to
\boxed{\mathrm{\Delta }\overrightarrow{r}={\overrightarrow{r}}_f-{\overrightarrow{r}}_i=\left(x_f-x_i\right)\ \hat{x}+\left(y_f-y_i\right)\hat{y}}
Displacement vector in a 3D coordinate system:
Consider a particle with initial and final position vectors shown in the figure below and defined by
{\overrightarrow{r}}_i=\left\langle x_i,y_i,z_i\right\rangle \ \ \ and \ \ \ {\overrightarrow{r}}_f=\left\langle x_f,\ y_f,z_f\right\rangle
The displacement vector of a point moving in the $xyz$-coordinate system is equal to
\boxed{\mathrm{\Delta }\overrightarrow{r}={\overrightarrow{r}}_f-{\overrightarrow{r}}_i=\left(x_f-x_i\right)\ \hat{x}+\left(y_f-y_i\right)\hat{y}+\left(z_f-z_i\right)\hat{z}}
Each component of the displacement vector now gives us the displacement along the corresponding axis and, overall, the entire vector gives the displacement of the particle in a 2D or 3D space.
Example: a particle located at ${\overrightarrow{r}}_i=4\hat{x}+3\hat{y}$ undergoes a displacement $\mathrm{\Delta }\overrightarrow{r}=-3\hat{x}+2\hat{y}$. What is its new position?
The position vector ${\overrightarrow{r}}_f$ of the particle after its displacement is equal to
{\overrightarrow{r}}_f={\overrightarrow{r}}_i+\mathrm{\Delta }\overrightarrow{r}=\left(4\hat{x}+3\hat{y}\right)+\left(-3\hat{x}+2\hat{y}\right)=\hat{x}+5\hat{y}