pow(a:float, b:float)->float
Calculates the power (b) raised to the base number (a).
c = pow(a, b) # c = a^b
noise3D(x:float, y:float, z:float)->float
Returns a pseudo random value using the Perlin noise algorithm.
noise2D(x:float, y:float)->float
Returns a pseudo random value using the Perlin noise algorithm.
noise(x:float)->float
Returns a pseudo random value using the Perlin noise algorithm.
toFloat(a:long)->float
Converts an int number to a float number.
toInt(a:float)->long
Converts a float number to an int type.
randomSeed(seed:int)
Initializes the pseudo-random number generator with the int parameter passed as seed.
ms = getMillis()
randomSeed(ms)
random()
deg(rad:float)->float
Converts a value in radians to degrees.
rad(deg:float)->float
Converts a value in degree measure to radians.
atan(rad:float)->float
Calculates the arc tangent value of the radian parameter.
s = atan(PI)
acos(rad:float)->float
Calculates the arc cosine value of the radian parameter.
s = acos(PI)
asin(rad:float)->float
Calculates the arc sine value of the radian parameter.
s = asin(PI)
tan(rad:float)->float
Calculates the Tanges value of the Radiant parameter.
t = tan(PI)
random(min:int,max:int)->int
Generates a random value between min and max (without max).
for i in 10:
x = random(0,240)
y = random(0,240)
drawCircle(x,y,20)
update()
Note:
The upper number (max) is not included. So for a dice between 1 and 6, random(1, 6+1) must be used.
round(n:float)->float
Rounds the value n to the integer value.
exp(n:float)->float
Exponential function:
e^n
e ~2.718...
log(n:float)->float
Calculates the natural logarithm of n.
a = e^x
x = log a
map(v:float,start1:float,stop2:float,start2:float,stop2:float)->float
Converts a value v of a value range start1/stop1 to the value range start2/stop2.
v = map(50,0,100,0,255) # 128
abs(a:float)->float
Calculates the absolute value of the number a.
a = abs(-1) # 1
lerp(a:float,b:float,t:float t)->float
Calculates the linear interpolation between a and b for parameter t (or extrapolation if t is outside the range [0,1]).
floor(a:float)->float
Returns the largest integer that is less than or equal to x (i.e.: rounds down to the nearest integer).
ceil(a:float)->float
Returns the smallest integer that is greater than or equal to x (i.e.: rounds up to the nearest integer).
max(a:float,b:float)->float
Returns the higher value of the two numbers a and b.
c = max(100,200) # 200
min(a:float,b:float)->float
Returns the lower value of the two numbers a and b.
c = min(100,200) # 100
cos(rad:float)->float
Calculates the Cosinuns value of the Radiant parameter.
c = cos(PI)
sqrt(a:float)->float
Calculates the square root of a.
b = sqrt(16)
sin(rad:float)->float
Calculates the sine value of the radian parameter.
s = sin(PI)
avg(a:float,b:float)->float
Returns the average of two numbers.
a = avg(100,200) # = 150