Skip to main content

Math

Math blocks provide mathematical operations and calculations for your simulations.

Overview

Math blocks enable you to perform numerical computations, generate random numbers, and execute complex mathematical operations in your StarLogo Nova simulations. These blocks are essential for calculations involving agent properties, environmental conditions, and simulation dynamics.

Block Categories

Random Number Generation

  • Random To - Generates a random integer between 0 and the specified value
  • Random Decimal - Generates a random decimal number between 0 and 1

Basic Arithmetic

  • Sum - Adds two numbers together
  • Difference - Subtracts the second number from the first number
  • Product - Multiplies two numbers together
  • Quotient - Divides the first number by the second number
  • Remainder Of - Returns the remainder after division

Trigonometric Functions

Advanced Functions

  • Sqrt - Calculates the square root of a number
  • Power - Raises a number to a specified power
  • Log - Calculates the base-10 logarithm
  • Ln - Calculates the natural logarithm

Mathematical Constants

  • Pi - Returns the mathematical constant π (pi)

Utility Functions