ChaosPro Home
Introduction
What's New
Palettes
Using Formulas
Layering in ChaosPro
Rendering
Fractal Parameter Windows
Windows
Menu
3D Transformations
Animations
Formula Compiler
Writing Formulas
Language Reference
Introduction
Basic Syntax
Datatypes
Constants
Variables
Expressions
Operators
Precedence
Arithmetic Operators
+
-
*
/
%
^
- (neg)
|a|
Assignment Operator
Comparison Operator
Logical Operators
Functions
Control Structures
Compiler Directives
Functions
Interface to ChaosPro
Special Features, Notes...
Compatibility
Fractal Type Reference
Tutorials
Appendix
CHAOSPRO 4.0
Release 4.0
.

Operators - |...| (modulus squared)

Operator :|...| - modulus squared
Unary / binary: Unary
Prefix / infix: N/A
Input data type Output data type
real real
complex real
vector real
quaternion real

Notes:


Normally this operator is defined to calculate the modulus of its operand. But due to compatibility reasons and due to speed this operator only calculates the modulus squared of its operand.

Thus this function is defined as follows:

  • for real numbers r: |r| := r*r
  • for complex numbers c=(cr,ci): |c| := cr*cr+ci*ci
  • for vectors v=(x,y,z): |v| := x*x+y*y+z*z
  • for quaternion numbers q=(qr,qi,qj,qk): |q| := qr*qr+qi*qi+qj*qj+qk*qk

If you want to calculate the modulus of a number, you can write sqrt(|c|) or use the function cabs.