Absolute Value

Formula

Abs( x ) = | x |

Description:

In mathematics, the absolute value or modulus |x| of a real number x is the non-negative value of x without regard to its sign.

Another way to think about it is how far the number is away from zero. Both 9 and -9 are 9 "units" away from zero. Therefore the Absolute Value

of 9 is 9 and the Absolute Value of -9 is also 9.

Operation Examples:

| 9 | = 9

| - 9 | = 9

| 28 | = 28

| - 28 | = 28

| 220 | = 220

| - 220 | = 220

Curve Examples:

Curve Function A: y = (1.0 - pow( abs( x ), 0.5 ) );

Curve Function B: y =  (1.0 - abs( x ));

Curve Function C: y = ( pow ( abs ( sin( x ) ), 10.0 );

GLSL Example

Coded in Shadertoy