Skip to main content
100%

Sigmoid Function

✓ Published0🌍 Public
CCharlesFr
Last edited Mar 29, 2017
Created on Mar 29, 2017

This example visualizes a sigmoid function, a smooth S-shaped curve that maps any real number to a range between negative one and positive one. It precomputes 200 samples of the function into a floating-point array, using an exponential formula with a steepness factor. A separate lookup function then retrieves values from this array by converting a given x-coordinate into an array index, applying flooring, scaling, and clamping to stay within bounds. The code uses the Processing language’s `exp`, `constrain`, and `floor` functions to generate and access the curve data.

AI-generated description

Similar vizzes