Abs

From StarLogo Nova Wiki
This page is a translated version of the page Abs and the translation is 20% complete.
Other languages:
The Absolute Value Block

Usage

Returns the absolute value of the input.

Syntax

Inputs in this block:

  1. a number

Example

Abs example gif
Abs example code

This is a model of molecules moving inside of a container. To ensure that the molecules stay within the bounds set by the volume slider, their position is calculated and corrected using the ‘bounce’ function. The absolute value button is used to make sure the molecules do not go outside the volume on either the negative or the positive x.