A Cartesian coordinate system is made up of linear unit vectors perpendicular to each other. A particle's position is
$$\vec{r}=<x,y,z>$$The unit vectors are:
$$\hat{x}=<1,0,0>$$$$\hat{y}=<0,1,0>$$$$\hat{z}=<0,0,1>$$We can also write the position vector in terms of these unit vectors.
$$\vec{r}=x\hat{x}+y\hat{y}+z\hat{z}$$The magnitude of the vector is
$$|\vec{r}|=\sqrt{x^2+y^2+z^2}$$Suppose that the position vector makes angles with the x, y, z axes of $(\theta_x)$, $(\theta_y)$, $(\theta_z)$ respectively. You can calculate each angle using direction cosines.
$$\cos\theta_x = \frac{x}{|\vec{r}|}$$$$\cos\theta_y = \frac{y}{|\vec{r}|}$$$$\cos\theta_z = \frac{z}{|\vec{r}|}$$