Difference between revisions of "Abs"
m (adding doc status category) |
|||
Line 2: | Line 2: | ||
[[Category:Doc Status C]] <!-- For Lumina use, do not change --> | [[Category:Doc Status C]] <!-- For Lumina use, do not change --> | ||
− | The absolute value of a number. | + | The absolute value of a number, or the magnitude of a complex number. |
− | Abs( | + | For a non-negative real number, <code>[[Abs]](x)</code> returns x. |
+ | |||
+ | For a negative real number, <code>[[Abs]](x)</code> returns -x. | ||
+ | |||
+ | |||
+ | |||
+ | For a [[Complex Numbers|complex number]], ''a + bj'', <code>[[Abs]](x)</code> returns the magnitude, equal to <math>\sqrt(a^2+b^2)</math>. | ||
+ | |||
+ | = Complex numbers = | ||
+ | |||
+ | A complex number can be written in standard (cartesian) form as <math>a + b j<math>, or in polar form as <math>r e^{\theta j}</math>. Given a complex number, x, <code>[[Abs]](x)</code> gives ''r'', the magnitude from the polar form. The <math>\theta</math> is given by either [[ComplexRadians]] (or [[ComplexDegrees]]). | ||
+ | |||
+ | = Examples = | ||
+ | |||
+ | :<code>[[Abs]](0)</code> → 0 | ||
+ | :<code>[[Abs]](-0.123)</code> → 0.123 | ||
+ | :<code>[[Abs]](4.534)</code> → 4.534 | ||
+ | :<code>[[Abs]](-[[INF]])</code> → [[INF]] | ||
+ | |||
+ | :<code>[[Abs]](-4-3j)</code> → 5 | ||
+ | :<code>[[Abs]](1j)</code> → 1 | ||
+ | |||
+ | = See Also = | ||
+ | |||
+ | * [[Sign]](x) | ||
+ | * [[Complex Numbers]] |
Revision as of 17:54, 11 April 2013
The absolute value of a number, or the magnitude of a complex number.
For a non-negative real number, Abs(x)
returns x.
For a negative real number, Abs(x)
returns -x.
For a complex number, a + bj, Abs(x)
returns the magnitude, equal to [math]\displaystyle{ \sqrt(a^2+b^2) }[/math].
Complex numbers
A complex number can be written in standard (cartesian) form as [math]\displaystyle{ a + b j\lt math\gt , or in polar form as \lt math\gt r e^{\theta j} }[/math]. Given a complex number, x, Abs(x)
gives r, the magnitude from the polar form. The [math]\displaystyle{ \theta }[/math] is given by either ComplexRadians (or ComplexDegrees).
Examples
See Also
Comments
Enable comment auto-refresher