views:

71

answers:

1

Hey all, what is the Actionscript 3 equivalent of PHP's deg2rad function?

+1  A: 

Googling "ActionScript deg2rad" came up with this:

function deg2rad(degree) {
     return degree * (Math.PI / 180);
}
Jordan
This is correct, but don't put this in a function in production code. Odds are you'll be calling this many times a frame, so just inline it where appropriate to save costs.
Cory Petosky