Mathematical tools

A set of mathematical functions that can be used in expressions.

Expressions

Expression Description
AngleBetweenPositions(number, number, number, number) Compute the angle between two positions.
number First point X position
number First point Y position
number Second point X position
number Second point Y position
AngleDifference(number, number) Difference between two angles
number First angle
number Second angle
DistanceBetweenPositions(number, number, number, number) Compute the distance between two positions.
number First point X position
number First point Y position
number Second point X position
number Second point Y position
abs(number) Absolute value
number Expression
acos(number) Arccosine
number Expression
acosh(number) Hyperbolic arccosine
number Expression
asin(number) Arcsine
number Expression
asinh(number) Arcsine
number Expression
atan(number) Arctangent
number Expression
atan2(number, number) 2 argument arctangent (atan2)
number Y
number X
atanh(number) Hyperbolic arctangent
number Expression
cbrt(number) Cube root
number Expression
ceil(number) Round number up to an integer
number Expression
clamp(number, number, number) Restrict a value to a given range
number Value
number Min
number Max
cos(number) Cosine of a number
number Expression
cosh(number) Hyperbolic cosine
number Expression
cot(number) Cotangent of a number
number Expression
csc(number) Cosecant of a number
number Expression
exp(number) Exponential of a number
number Expression
floor(number) Round number down to an integer
number Expression
lerp(number, number, number) Linearly interpolate a to b by x
number a (in a+(b-a) * x)
number b (in a+(b-a) * x)
number x (in a+(b-a) * x)
log(number) Logarithm
number Expression
log10(number) Base-10 logarithm
number Expression
log2(number) Base 2 Logarithm
number Expression
max(number, number) Maximum of two numbers
number First expression
number Second expression
min(number, number) Minimum of two numbers
number First expression
number Second expression
mod(number, number) x mod y
number x (as in x mod y)
number y (as in x mod y)
normalize(number, number, number) Remap a value between 0 and 1.
number Value
number Min
number Max
nthroot(number, number) Nth root of a number
number Number
number N
pow(number, number) Raise a number to power n
number Number
number The exponent (n in “x to the power n”)
round(number) Round a number
number Expression
sec(number) Secant
number Expression
sign(number) Return the sign of a number (1,-1 or 0)
number Expression
sin(number) Sine of a number
number Expression
sinh(number) Hyperbolic sine
number Expression
sqrt(number) Square root of a number
number Expression
tan(number) Tangent of a number
number Expression
tanh(number) Hyperbolic tangent
number Expression
trunc(number) Truncate a number
number Expression

This page is an auto-generated reference page about the Mathematical tools feature of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop features here.