title: Actionscript Angle of a Line Trig
body: <p>How can I find the Angle of a line between two points in actionscript 3.</p>
  
  <p>I have an object that dynamically animates out arrows, given the points that represent start, elbows, and then end point.</p>
  
  <p>I need the angle of the line to rotate the arrow at the tip to accurately point with the current segment being drawn</p>
  
  <p>I can easily get the angle for right angled lines by detecting if one axis is 0 but need the angle of any line between two points.</p>
  
  <p>I'm familiar with getting the Points for a line e.g. draw a 100px line at 47 degrees:</p>
  
  <pre><code>var length:Number = 100;
  var angle:uint = 48
  graphics.lineTo(Math.cos(angle) * length, Math.sin(angle) * length);
  </code></pre>
  
  <p>but am struggling to get the angle from the line:</p>
  
  <p>what I need is</p>
  
  <p>given start point and end point of a line, what is the angle of the line.</p>
  
  <p>many thanks for any and all suggustions</p>