if you have two points, we can state the following let $P_1(x_1,y_1,z_1)$ and $P_2(x_2,y_2,z_2)$ be your two points and $\alpha, \beta, \gamma$, the angles to the X,Y,Z axes respectively; if we want to find the direction (or the angles two the X,Y,Z axes) of the segment formed by the two points $\overline{P_1 P_2}$ these are obtained from these formulas:
$$\cos{\alpha}=\frac{\Delta x}{d},\cos{\beta}=\frac{\Delta y}{d},\cos{\gamma}=\frac{\Delta z}{d}$$
where d is the distance between the two points which is given by the following formula:
$$d=\sqrt{(\Delta x)^2+(\Delta y)^2+(\Delta z)^2}$$
Once you've found the values of each cosine, you can use their inverse trigonometric function to find each angle, we would have this:
$$\alpha = \arccos{\frac{\Delta x}{d}}, \beta = \arccos{\frac{\Delta y}{d}}, \gamma = \arccos{\frac{\Delta z}{d}}$$
Alternatively, if you are looking for th angles that each point forms with the three axes, let $O(0,0,0)$ be the origin and use it to find the direction of the two segments $\overline{O P_1}$ and $\overline{O P_2}$ as explained above.
I hope that this is what your looking for.
Regards Tristian.