hi EveryOne,
Can anybody tell me how to find an angle between two lines in flash.
Thanks in advance
Deepthi
hi EveryOne,
Can anybody tell me how to find an angle between two lines in flash.
Thanks in advance
Deepthi
work out the gradients:
var gradient:Number = (y2 - y1) / (x2 - x1);
where (x1,y1) are the starting coordinates and (x2,y2) the ending coordinates of the line
convert the gradient to an angle:
var angle:Number = Math.atan(gradient);
minus one from the other, get the absolute value and convert from radians to degrees:
var difference:Number = Math.abs(angle1-angle2)*180/Math.PI; hope that helped.
Hey Tuncays, that’s really cool.
sweet++;
Thanks for sharing.
:: Copyright KIRUPA 2024 //--