Hi,
I'm trying to understand some flash animation, and am having difficulty working out the following. Can anyone help?
I want to convert a degree range of 0 to 90, to a value between 0 and 1
These is an existing function to convert from the range 0 to 1 to degrees, eg:
function convertToDegrees(Int:Pos)
{
var rot = (45 * pos);
var degrees = (90 - ( rot * 2 ));
return degrees;
}
Now to convert backwards, from degrees to 0 to 1 value, I am trying: (WHICH IS WRONG)
function convertFromDegrees(Int:currentDegreeValue )
{
var rot = (currentDegreeValue / 2) + 90;
var Pos = rot / 45;
return Pos;
}
Can anyone help me as to where I am going wrong?