Angle between two points in Cartesian coordinate system C++
The parametric equation for a spiral is:

$$
\begin{eqnarray}
\begin{aligned}
    x &amp;= &amp;(a + b \theta) \times \cos(\theta)\\
    z &amp;= &amp;(a + b \theta) \times \sin(\theta)
\end{aligned}
\end{eqnarray}
$$

The direction on the spiral point is simply the derivative of the system with respect to $\theta$. Thus the direction is: 

$$
\begin{eqnarray}
\begin{aligned}
 x_{dir} &amp;=&amp;-(a + b \theta) \times \sin(\theta) + b \times \cos(\theta)\\
 z_{dir} &amp;=&amp;(a + b \theta) \times \cos(\theta) + b \times \sin(\theta)
\end{aligned}
\end{eqnarray}
$$

Finally angle is is simply atan2 of the direction equation. 



Image 1: This is what I get when i plot squares at $(x, z)$ with direction $(x_{dir}, z_{dir})$

Mathematica source for image