In Sketchware Pro, Math blocks help you perform mathematical calculations and get device screen dimensions. You can use them to find screen sizes, calculate powers, round decimals, find minimum/maximum numbers, and use trigonometry.
Built-in Math Blocks
getDip ()

Converts a density-independent pixel (dp) value into physical screen pixels on the user's phone. This helps you draw or size views so they look the same physical size across different screen resolutions.
getDisplayWidthPixels
![]()
Returns the full width of the device screen in real pixels. Useful for centering elements or making views fill half or full screen width.
getDisplayHeightPixels
![]()
Returns the full height of the device screen in real pixels. Useful for calculating layouts based on the available screen height.
PI (π)
Returns the mathematical constant Pi (approximately 3.14159...). Useful when calculating circle circumference, area, or rotation.
E (e)
Returns Euler's number constant e (approximately 2.71828...). Used in growth and decay math calculations.
() to the () power

Raises the first number to the power of the second number. For example, 2 to the power of 3 gives 8 (2 * 2 * 2).
minimum of () and ()

Compares two numbers and returns whichever one is smaller. For example, minimum of 4 and 9 gives 4.
maximum of () and ()

Compares two numbers and returns whichever one is bigger. For example, maximum of 4 and 9 gives 9.
square root of ()

Returns the square root of a number. For example, square root of 25 returns 5 because 5 * 5 = 25.
absolute value of ()

Removes any negative sign and turns negative numbers into positive numbers. Positive numbers stay positive. For example, -8 becomes 8, and 8 stays 8.
round ()

Rounds a decimal number to the nearest whole number. For example, 4.3 rounds down to 4, and 4.7 rounds up to 5.
ceil ()

Always rounds a decimal number up to the nearest whole integer (ceiling). For example, 4.1 rounds up to 5.
floor ()

Always rounds a decimal number down to the nearest whole integer (floor). For example, 4.9 rounds down to 4.
sin ()

Returns the trigonometric sine of an angle given in radians.
cos ()

Returns the trigonometric cosine of an angle given in radians.
tan ()

Returns the trigonometric tangent of an angle given in radians.
arcsin ()

Calculates the inverse sine (arcsine) of a value and returns the angle in radians.
arccos ()

Calculates the inverse cosine (arccosine) of a value and returns the angle in radians.
arctan ()

Calculates the inverse tangent (arctangent) of a value and returns the angle in radians.
exp ()

Returns Euler's number e raised to the power of the given number (e^x).
ln ()

Calculates the natural logarithm (base e) of a number.
log ()

Calculates the common base-10 logarithm of a number. For example, log of 100 is 2.
Degree () to Radian

Converts an angle from degrees (like 180°) into radians (like 3.14159...), which is needed for functions like sin and cos.
Radian () to Degree

Converts an angle from radians back into standard degrees (from 0° to 360°).
Bottom line
That was the explanation for every built-in Math block in Sketchware Pro. If you think some info is wrong or doesn't exist, please let us know in our discord server or simply open a Pull Request in our website's GitHub repository.