# Extended math support Additional math functions and constants as expressions and conditions.

Authors and contributors to this community extension: Add00, Jurfix.

Expressions:

• Mathematical constants
• Greatest common factor/Lowest common multiple
• Factorial
• Coordinates conversion for polar and isometric systems
• ToFixedString: Formats a number into a string with the specified number of decimal places
• ToFixed: (Deprecated) Formats a number to use the specified number of decimal places

Conditions:

• IsEven: Check if the number is even (divisible by 2)

Release Notes:

Version 1.0.7

• Deprecated ToFixed() because it does not show any trailing zeros for whole numbers. Prefer using ToFixedString() to set values in text objects.

Tip

Learn how to install new extensions by following a step-by-step guide.

## Conditions

Is even?
Check if the number is even (divisible by 2). To check for odd numbers, invert this condition.

## Expressions

Expression Description
`ExtendedMath::E()` Returns the natural logarithm of e. (Euler's number).
`ExtendedMath::Factorial(number)` Returns the input multiplied by all the previous whole numbers.
🔢 Number Any positive integer
`ExtendedMath::Fibonacci(number)` Returns a term from the Fibonacci sequence.
🔢 Number The desired term in the sequence
`ExtendedMath::Gcf(number, number)` Returns the greatest common factor of two numbers.
🔢 Number Any integer
🔢 Number Any integer
`ExtendedMath::GoldenRatio()` Returns the golden ratio.
`ExtendedMath::HalfPi()` Returns half Pi.
`ExtendedMath::Hypot(number, number)` Returns the value of the length of the hypotenuse.
🔢 Number First side of the triangle
🔢 Number Second side of the triangle
`ExtendedMath::IisoToCartesianY(number, number)` Converts a isometric coordinate into the Cartesian y value.
🔢 Number Position on the x axis
🔢 Number Position on the y axis
`ExtendedMath::IsoToCartesianX(number, number)` Converts a isometric coordinate into the Cartesian x value.
🔢 Number Position on the x axis
🔢 Number Position on the y axis
`ExtendedMath::Lcm(number, number)` Returns the lowest common multiple of two numbers.
🔢 Number Any integer
🔢 Number Any integer
`ExtendedMath::Ln10()` Returns the natural logarithm of 10.
`ExtendedMath::Ln2()` Returns the natural logarithm of 2.
`ExtendedMath::Log10e()` Returns the base 10 logarithm of e. (Euler's number).
`ExtendedMath::Log2e()` Returns the base 2 logarithm of e. (Euler's number).
`ExtendedMath::Map(number, number, number, number, number)` Converts a number of one range e.g. 0-1 to another 0-255.
🔢 Number The value to convert
🔢 Number The lowest value of the first range
🔢 Number The highest value of the first range
🔢 Number The lowest value of the second range
🔢 Number The highest value of the second range
`ExtendedMath::Pi()` Returns Pi (π).
`ExtendedMath::PolarToCartesianX(number, number)` Converts a polar coordinate into the Cartesian x value.
🔢 Number Angle or theta in radians
`ExtendedMath::PolarToCartesianY(number, number)` Converts a polar coordinate into the Cartesian y value.
🔢 Number Angle or theta in radians
`ExtendedMath::QuarterPi()` Returns quarter Pi.
`ExtendedMath::Slope(number, number, number, number)` Calculates the steepness of a line between two points.
🔢 Number X value of the first point
🔢 Number Y value of the first point
🔢 Number X value of the second point
🔢 Number Y value of the second point
`ExtendedMath::Sqrt1_2()` Returns square root of 1/2.
`ExtendedMath::Sqrt2()` Returns square root of 2.
`ExtendedMath::ToFixedString(number, number)` Formats a number to a string with the specified number of decimal places.
🔢 Number The value to be rounded
🔢 Number Number of decimal places