function distance(x1,y1,x2,y2,rounded)
{
var distanceX = x2-x1;
var distanceY = y2-y1;
if(rounded == false)
{
return(Math.sqrt(distanceX * distanceX + distanceY * distanceY));
}
else
{
return(Math.round(Math.sqrt(distanceX * distanceX + distanceY * distanceY)));
}
}
function random_numberGen(minimumNumberAllowed,maximumNumberAllowed)
{
do
{
randomX = (Math.round(Math.random()*maximumNumberAllowed));
}
while(randomX < minimumNumberAllowed)
return(randomX);
}
Thursday, December 13, 2007
Flash Actionscript Math Util
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment