Complex
The Complex type provides support for working with complex numbers in Mathematics.NET.
Overview
Any complex number can be written in the form
where and are real numbers and is the imaginary unit, which has the property . The set of complex numbers is denoted by .1
Implements
- Name
IComplex{T}- Type
- interface
- Description
Defines support for complex numbers.
- Name
IDifferentiableFunctions{T}- Type
- interface
- Description
Defines support for common differentiable functions.
Re
Get the real part of a complex number.
Return Type
- Name
result- Type
- Real
- Description
A real number.
Snippet
Complex z = new(1, 2);
z.Re;
Result
1
Im
Get the imaginary part of a complex number.
Return Type
- Name
result- Type
- Real
- Description
A real number.
Snippet
Complex z = new(1, 2);
z.Re;
Result
2
Magnitude
Get the magnitude of a complex number.
Let , where and are real numbers and is the complex unit. The, the magnitude of , written as , is
The magnitude of a complex number is non-negative.
Return Type
- Name
result- Type
- Real
- Description
A real number.
Snippet
Complex z = new(3, 4);
z.Magnitude;
Result
5
Phase
Get the phase of a complex number.
Let , where and are real numbers and is the complex unit. The, the magnitude of , written as , is
where .
For the single-argument arctangent, , the domain of the result will be different, .
Return Type
- Name
result- Type
- Real
- Description
A real number.
Snippet
Complex z = new(3, 4);
z.Phase;
Result
0.9272952180016122
Conjugate
Compute the conjugate, , of a complex number.
Let , where and are real numbers and is the complex unit. Then, the complex conjugate of , written as , is
Required Parameters
- Name
z- Type
- Complex
- Description
A complex number.
Return Type
- Name
result- Type
- Complex
- Description
A complex number.
Snippet
Complex z = new(1, 2);
Complex.Conjugate(z);
Result
(1,-2)
Footnotes
-
See Complex Variables and Applications by James Ward Brown and Ruel V. Churchill for an introduction to Complex Analysis. ↩