Les fonctions mathématiques

 

Si vous exportez un script dans lequel sont incorporées des fonctions mathématiques, vous devez cocher Shared advanced math library dans l'onglet Export (Script sélectionné) afin de réduire la taille du code exporté.

Appel'(sauf mention contraire) : Math.NomFonction(argument)

abs(number)Returns absolute value of a number.acos(number)Returns angle in radians. cosine must be between -1 and 1 of course.
acosdeg(number)Returns angle in degrees. cosine must be between -1 and 1 of course. incompatible Flash MXapproach(current, final, factor) compute ((current - final) * factor + final) if factor > 1 , object moves away from final accelerating at start. if 0 < factor < 1 , object go to final slowing down at end. incompatible Flash MX
asin(number)Returns angle in radians. sine must be between -1 and +1 of course.asindeg(number)Returns angle in degrees. sine must be between -1 and +1 of course. incompatible Flash MX
atan(number)Returns angle in radians.atandeg(number)Returns angle in degrees. incompatible Flash MX
atan2(y, x)Returns angle in radians from tangente y/x. handle null values. ( Returns 0 if x=y=0 !!!)atan2deg(y, x)Returns angle in degrees from tangente y/x. handle null values. ( Returns 0 if x=y=0 !!!) incompatible Flash MX
ceil(number)Returns integer greater than number (or =).chance(percentage)Returns 1 in 'percentage' chances over 100 else Returns 0. incompatible Flash MX
clamp(number, low, high)if number ≤ 'low' Returns 'low'. if number ≥ 'high' Returns 'high'. else Returns number. incompatible Flash MXcos(radians)Returns cosine of angle expressed in radians
cosdeg(degrees)Returns cosine of angle expressed in degrees. incompatible Flash MXdegrees(radians)Returns in degrees an angle expressed in radians. incompatible Flash MX
distance(x1, y1, x2, y2)distance between 2 points.distanceSq(x1, y1, x2, y2) square of distance between 2 points.
exp(number)Returns the value e, to the power of the exponent specified in number. floor(number)Returns the lowest integer (or =) of number specified
log(number)Returns the natural logarithm of positive number.log10(number)Returns the log base 10 of positive number.
max(number, ...)Returns the highest value in a list of numbers separated with commas. 2 arguments only with Flash MX.min(number, ...)Returns the lowest value in a list of numbers separated with commas. 2 arguments only with Flash MX.
PIconstant PI.pow(base, exponent)Returns base to the power exponent. if base > 0 then exponent must be > 0.
radians(degrees)converts into radians a number in degrees. Don't exist with Flash MXrandom()Returns a random number between 0 included and 1 excluded. (accuracy : 5 digits after dot)
randomlmt(max)Returns a random integer between 0 included and 'max' excluded. Don't exist with Flash MXrandomRange(mini, maxi)Returns a random number between 'min' included and 'max' excluded. (accuracy : 5 digits after dot) Don't exist with Flash MX
round(number)Returns the closest integer.sign(number)Returns +1 if number > 0. Returns 0 if number = 0. Returns -1 if number < 0.
sin(radians)Returns sine of an angle in radians.sindeg(degrees)Returns sine of an angle in degrees. Don't exist with Flash MX.
sqrt(number)Returns square root of a positive number.SQRT1_2Returns 0,707106.
SQRT2Returns 1,414213.tan(radians)Returns tangente of an angle in radians.
tandeg(degrees)Returns tangente of an angle in degrees. Don't exist with Flash MX.

 


Si vous aimez le site

 

Select a language if you need :


Page chargée en 0.003 sec.

Dernière Modification : Mer 25 Janvier 2017 8:56
Copyright © 1999-2017 Jean-Paul Molina Tous droits réservés.

to Google