title: calculate the angle between a line and x-axis
body: <p>I have two points in my coordinate system <code>(x,y)</code> that I want to know the angle of their line and x-axis.</p>
  
  <p>I use swift for solving this but I can't get the angle.</p>
  
  <p>I need this angle in radians to use it in the following equation:</p>
  
  <pre><code>(x0 + r cos theta, y0 + r sin theta)
  </code></pre>
  
  <p>r : radius of circle</p>