Absolute Value Operator

The absolute value operator returns the distance from zero on the number line of a number. For example, the absolute value of is since is three units from zero on the number line. Similarly, the absolute value of is also since it is three units from zero on the number line.

Examples

Usage

In practice, the absolute value function can be used to calculate the absolute value of a number.

Formulas

Distance Between Two Points 1D

The distance between two points, in one dimension, is given by the absolute value of the difference between the two values.

Distance Between Two Points 2D

The distance between two points, in two dimensions, is given by solving Pythagorean's theorem for the length of the hypotenuse of the right triangle formed by the two points.

Links