Archive for the 'Formula' Category

06
Feb

Convert degrees to radians & radians to degrees

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

These are two useful formulas that you will use more often than not.

degrees to radians

var degrees:Number =  radians * 180 / Math.PI

radians to degrees

var radians:Number = degrees * Math.PI / 180

Found this useful? How about buying me a coffee - simply click here.

06
Feb

Distance Between two Points

This is one of the most useful formulas that I use. This formula measures the distance between any 2 given points…

These points can be coordinates, movie clips, mouse position, ect…

Full code after the jump.

dx = x2 – x1;
dy = y2- y1;
Dist = Math.sqrt(dx*dx + dy*dy)

Found this useful? How about buying me a coffee - simply click here.




Close
E-mail It