Archive for the ‘Language’ Category

Arcsine, Arccosine, Arctangent.

Wednesday, March 17th, 2010

Basically, all these do is the reverse of sine and cosine. In other words, you feed in a ratio, and you get back an angle (in radians).

var sin30:Number = Math.sin(30*Math.PI/180);
trace(sin30); //0.5 or 0.4999999
 
var arsin05:Number = Math.asin(0.5)*180/Math.PI;
trace(arsin05); //30.000...