2.2.3.3 complex
Contents
Name
complex
Remark
The Origin C complex class implements a complex number data type containing both a Real and an Imaginary component.
Hierarchy
- complex
Examples
EX1
void complex_complex_ex1() { complex cc(4.5, 7.8); out_double("Real part = ", cc.m_re); //Result is "Real part = 4.5" out_double("Imaginary part = ", cc.m_im); //Result is "Imaginary part = 7.8" cc = cc.Conjugate(); out_double("Real part = ", cc.m_re); //Result is "Real part = 4.5" out_double("Imaginary part = ", cc.m_im); //Result is "Imaginary part = -7.8" }
Header to Include
origin.h
Reference
Members
| Name | Brief | Example |
|---|---|---|
| default constructor which constructs a complex value with both the real and the imaginary part being zero. | ||
| it returns the complex conjugate of the value | ||
| returns the amplitude(modulus) of the complex value. | ||
| returns the phase in radians, of the complex value. |
Property
| Name | Brief | Example |
|---|---|---|
| the property representing the imaginary part of the complex value. | ||
| the property representing the real part of the complex value. |