How can I find the Angle of a line between two points in actionscript 3.
I have an object that dynamically animates out arrows, given the points that represent start, elbows, and then end point.
I need the angle of the line to rotate the arrow at the tip to accurately point with the current segment being drawn
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.
I'm familiar with getting the Points for a line e.g. draw a 100px line at 47 degrees:
var length:Number = 100;
var angle:uint = 48
graphics.lineTo(Math.cos(angle) * length, Math.sin(angle) * length);
but am struggling to get the angle from the line:
what I need is
given start point and end point of a line, what is the angle of the line.
many thanks for any and all suggustions