BGC Tools
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Properties | Static Private Member Functions | Private Attributes
BGC.Mathematics.Complex32 Struct Reference

Represents a complex number with single-precision floating point components More...

Inheritance diagram for BGC.Mathematics.Complex32:
Inheritance graph
[legend]
Collaboration diagram for BGC.Mathematics.Complex32:
Collaboration graph
[legend]

Public Member Functions

 Complex32 (float real, float imaginary)
 Initializes a new Complex32 structure using the specified real and imaginary values. More...
 
Complex32 Square ()
 The Square (power 2) of this Complex32 More...
 
Complex32 Rotation (float phase)
 Retuns the Complex32 number, rotated by phase radians, or exp(i*phase) More...
 
float RealRotation (float phase)
 Retuns the real value of the Complex32 number after rotation by phase radians, or exp(i*phase) More...
 
bool Equals (in Complex32 value)
 Returns a value that indicates whether the current instance and a specified complex number have the same value. More...
 
bool IEquatable< Complex32 >. Equals (Complex32 other)
 Returns a value that indicates whether the current instance and a specified complex number have the same value. More...
 
override bool Equals (object obj)
 Returns a value that indicates whether the current instance and a specified object have the same value. More...
 
override int GetHashCode ()
 Returns the hash code for the current Complex32 object. More...
 
string ToString (string format)
 Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format for its real and imaginary parts. More...
 
string ToString (IFormatProvider provider)
 Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified culture-specific formatting information. More...
 
string ToString (string format, IFormatProvider provider)
 Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format and culture-specific format information for its real and imaginary parts. More...
 
override string ToString ()
 Converts the value of the current complex number to its equivalent string representation in Cartesian form. More...
 
bool IsReal ()
 Gets a value indicating whether the provided Complex32 is real. More...
 
bool IsRealNonNegative ()
 Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0. More...
 
bool IsZero ()
 Gets a value indicating whether the Complex32 is zero. More...
 
bool IsOne ()
 Gets a value indicating whether the Complex32 is one. More...
 
bool IsImaginaryOne ()
 Gets a value indicating whether the Complex32 is the imaginary unit. More...
 
bool IsInfinity ()
 Gets a value indicating whether the provided Complex32 evaluates to an infinite value. More...
 
bool IsNaN ()
 Gets a value indicating whether the provided Complex32evaluates to a value that is not a number. More...
 
Complex32 Power (in Complex32 exponent)
 Raise this Complex32 to the given value. More...
 
Complex32 NaturalLogarithm ()
 Natural Logarithm of this Complex32 (Base E). More...
 
Complex32 CommonLogarithm ()
 Common Logarithm of this Complex32 (Base 10). More...
 
Complex32 Logarithm (float baseValue)
 Logarithm of this Complex32 with custom base. More...
 
Complex32 Exponential ()
 Exponential of this Complex32 (exp(x), E^x). More...
 
float RealProduct (in Complex32 other)
 Returns the real component of the product of this Complex32 with other. More...
 
Complex32 Conjugate ()
 Computes the conjugate of a complex number and returns the result. More...
 
Complex32 Reciprocal ()
 Returns the multiplicative inverse of a complex number. More...
 
Complex32 SquareRoot ()
 The Square Root (power 1/2) of this Complex32 More...
 

Static Public Member Functions

static float Abs (in Complex32 value)
 Gets the absolute value (or magnitude) of a complex number. More...
 
static Complex32 Acos (in Complex32 value)
 Trigonometric principal Arc Cosine of this Complex32 number. More...
 
static Complex32 Add (in Complex32 left, in Complex32 right)
 Returns the sum of the two Complex32 inputs More...
 
static Complex32 Asin (in Complex32 value)
 Trigonometric principal Arc Sine of this Complex32 number. More...
 
static Complex32 Atan (in Complex32 value)
 Trigonometric principal Arc Tangent of this Complex32 number. More...
 
static Complex32 Conjugate (in Complex32 value)
 Computes the conjugate of a complex number and returns the result. More...
 
static Complex32 Cos (in Complex32 value)
 Trigonometric Cosine of a Complex32 number. More...
 
static Complex32 Cosh (in Complex32 value)
 Hyperbolic Cosine of a Complex32 number. More...
 
static Complex32 Divide (in Complex32 dividend, in Complex32 divisor)
 Divides one complex number by another and returns the result. More...
 
static Complex32 Exp (in Complex32 value)
 Returns e raised to the power specified by a complex number. More...
 
static Complex32 FromPolarCoordinates (float magnitude, float phase)
 Creates a complex number from a point's polar coordinates. More...
 
static Complex32 FromPolarCoordinates (double magnitude, double phase)
 Creates a complex number from a point's polar coordinates. More...
 
static Complex32 Log (in Complex32 value)
 Returns the natural (base e) logarithm of a specified complex number. More...
 
static Complex32 Log (in Complex32 value, float baseValue)
 Returns the logarithm of a specified complex number in a specified base. More...
 
static Complex32 Log10 (in Complex32 value)
 Returns the base-10 logarithm of a specified complex number. More...
 
static Complex32 Multiply (in Complex32 left, in Complex32 right)
 Returns the product of two complex numbers. More...
 
static Complex32 Negate (in Complex32 value)
 Returns the additive inverse of a specified complex number. More...
 
static Complex32 Pow (in Complex32 value, float power)
 Returns a specified complex number raised to a power specified by a float-precision floating-point number. More...
 
static Complex32 Pow (in Complex32 value, in Complex32 power)
 Returns a specified complex number raised to a power specified by a complex number. More...
 
static Complex32 Reciprocal (in Complex32 value)
 Returns the multiplicative inverse of a complex number. More...
 
static Complex32 Sin (in Complex32 value)
 Trigonometric Sine of a Complex32 number. More...
 
static Complex32 Sinh (in Complex32 value)
 Hyperbolic Sine of a Complex32 number. More...
 
static Complex32 Sqrt (in Complex32 value)
 The Square Root of a complex number More...
 
static Complex32 Subtract (in Complex32 left, Complex32 right)
 The difference between two Complex32 numbers; More...
 
static Complex32 Tan (in Complex32 value)
 Trigonometric Tangent of a Complex32 number. More...
 
static Complex32 Tanh (in Complex32 value)
 Hyperbolic Tangent of a Complex32 number. More...
 
static Complex32 operator+ (in Complex32 left, in Complex32 right)
 Adds two complex numbers. More...
 
static Complex32 operator- (in Complex32 value)
 Returns the additive inverse of a specified complex number. More...
 
static Complex32 operator- (in Complex32 left, in Complex32 right)
 Subtracts a complex number from another complex number. More...
 
static Complex32 operator* (in Complex32 left, in Complex32 right)
 Multiplies two specified complex numbers. More...
 
static Complex32 operator/ (in Complex32 dividend, in Complex32 divisor)
 Divides a specified complex number by another specified complex number. More...
 
static bool operator== (in Complex32 left, in Complex32 right)
 Returns a value that indicates whether two complex numbers are equal. More...
 
static bool operator!= (in Complex32 left, in Complex32 right)
 Returns a value that indicates whether two complex numbers are not equal. More...
 
static implicit operator Complex32 (byte value)
 Defines an implicit conversion of an unsigned byte to a complex number. More...
 
static implicit operator Complex32 (float value)
 Defines an implicit conversion of a single-precision floating-point number to a complex number. More...
 
static implicit operator Complex32 (double value)
 Defines an implicit conversion of a double-precision floating-point number to a complex number. More...
 
static implicit operator Complex32 (sbyte value)
 Defines an implicit conversion of a signed byte to a complex number. More...
 
static implicit operator Complex32 (ulong value)
 Defines an implicit conversion of a 64-bit unsigned integer to a complex number. More...
 
static implicit operator Complex32 (uint value)
 Defines an implicit conversion of a 32-bit unsigned integer to a complex number. More...
 
static implicit operator Complex32 (ushort value)
 Defines an implicit conversion of a 16-bit unsigned integer to a complex number. More...
 
static implicit operator Complex32 (long value)
 Defines an implicit conversion of a 64-bit signed integer to a complex number. More...
 
static implicit operator Complex32 (int value)
 Defines an implicit conversion of a 32-bit signed integer to a complex number. More...
 
static implicit operator Complex32 (short value)
 Defines an implicit conversion of a 16-bit signed integer to a complex number. More...
 
static operator Complex32 (decimal value)
 Defines an explicit conversion of a System.Decimal value to a complex number. More...
 

Data Fields

float Imaginary => _imag
 Gets the imaginary component of the current System.Numerics.Complex32 object. More...
 
float Real => _real
 Gets the real component of the current System.Numerics.Complex32 object. More...
 
float Phase => _imag == 0f && _real < 0f ? Mathf.PI : Mathf.Atan2(_imag, _real)
 Gets the phase of a complex number in radians. More...
 
float MagnitudeSquared => (_real * _real) + (_imag * _imag)
 Gets the squared magnitude (or squared absolute value) of a complex number. More...
 

Static Public Attributes

static readonly Complex32 Zero = new Complex32(0f, 0f)
 Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to zero. More...
 
static readonly Complex32 One = new Complex32(1f, 0f)
 Returns a new Complex32 instance with a real number equal to one and an imaginary number equal to zero. More...
 
static readonly Complex32 ImaginaryOne = new Complex32(0f, 1f)
 Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to one. More...
 
static readonly Complex32 PositiveInfinity = new Complex32(float.PositiveInfinity, float.PositiveInfinity)
 Returns a new Complex32 instance with real and imaginary numbers positive infinite. More...
 
static readonly Complex32 NaN = new Complex32(float.NaN, float.NaN)
 Returns a new Complex32 instance with real and imaginary numbers not a number. More...
 

Properties

float Magnitude [get]
 Gets the magnitude (or absolute value) of a complex number. More...
 

Static Private Member Functions

static Complex32 InternalDiv (float a, float b, float c, float d, bool swapped)
 Helper method for dividing. More...
 

Private Attributes

readonly float _real
 The real component of the complex number. More...
 
readonly float _imag
 The imaginary component of the complex number. More...
 

Detailed Description

Represents a complex number with single-precision floating point components

Definition at line 41 of file Complex32.cs.

Constructor & Destructor Documentation

◆ Complex32()

BGC.Mathematics.Complex32.Complex32 ( float  real,
float  imaginary 
)
inline

Initializes a new Complex32 structure using the specified real and imaginary values.

Definition at line 84 of file Complex32.cs.

85  {
86  _real = real;
87  _imag = imaginary;
88  }
readonly float _imag
The imaginary component of the complex number.
Definition: Complex32.cs:53
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47

Member Function Documentation

◆ Abs()

static float BGC.Mathematics.Complex32.Abs ( in Complex32  value)
static

Gets the absolute value (or magnitude) of a complex number.

Referenced by BGC.Mathematics.Complex32.SquareRoot().

Here is the caller graph for this function:

◆ Acos()

static Complex32 BGC.Mathematics.Complex32.Acos ( in Complex32  value)
inlinestatic

Trigonometric principal Arc Cosine of this Complex32 number.

Parameters
valueThe complex value.
Returns
The arc cosine of a complex number.

Definition at line 155 of file Complex32.cs.

156  {
157  if (value.Imaginary < 0f || value.Imaginary == 0f && value.Real > 0f)
158  {
159  return Mathf.PI - Acos(-value);
160  }
161 
162  return -ImaginaryOne * (value + (ImaginaryOne * (1f - value.Square()).SquareRoot())).NaturalLogarithm();
163  }
static readonly Complex32 ImaginaryOne
Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to on...
Definition: Complex32.cs:69
Complex32 NaturalLogarithm()
Natural Logarithm of this Complex32 (Base E).
Definition: Complex32.cs:757
Complex32 SquareRoot()
The Square Root (power 1/2) of this Complex32
Definition: Complex32.cs:829
static Complex32 Acos(in Complex32 value)
Trigonometric principal Arc Cosine of this Complex32 number.
Definition: Complex32.cs:155

◆ Add()

static Complex32 BGC.Mathematics.Complex32.Add ( in Complex32  left,
in Complex32  right 
)
static

Returns the sum of the two Complex32 inputs

◆ Asin()

static Complex32 BGC.Mathematics.Complex32.Asin ( in Complex32  value)
inlinestatic

Trigonometric principal Arc Sine of this Complex32 number.

Parameters
valueThe complex value.
Returns
The arc sine of a complex number.

Definition at line 176 of file Complex32.cs.

177  {
178  if (value.Imaginary > 0f || value.Imaginary == 0f && value.Real < 0f)
179  {
180  return -Asin(-value);
181  }
182 
183  return -ImaginaryOne * ((1f - value.Square()).SquareRoot() + (ImaginaryOne * value)).NaturalLogarithm();
184  }
static readonly Complex32 ImaginaryOne
Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to on...
Definition: Complex32.cs:69
Complex32 NaturalLogarithm()
Natural Logarithm of this Complex32 (Base E).
Definition: Complex32.cs:757
static Complex32 Asin(in Complex32 value)
Trigonometric principal Arc Sine of this Complex32 number.
Definition: Complex32.cs:176
Complex32 SquareRoot()
The Square Root (power 1/2) of this Complex32
Definition: Complex32.cs:829

◆ Atan()

static Complex32 BGC.Mathematics.Complex32.Atan ( in Complex32  value)
inlinestatic

Trigonometric principal Arc Tangent of this Complex32 number.

Parameters
valueThe complex value.
Returns
The arc tangent of a complex number.

Definition at line 192 of file Complex32.cs.

References BGC.Mathematics.Complex32.Conjugate().

193  {
194  Complex32 iz = new Complex32(-value.Imaginary, value.Real); // I*this
195  return new Complex32(0f, 0.5f) * ((1f - iz).NaturalLogarithm() - (1f + iz).NaturalLogarithm());
196  }
Complex32 NaturalLogarithm()
Natural Logarithm of this Complex32 (Base E).
Definition: Complex32.cs:757
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:

◆ CommonLogarithm()

Complex32 BGC.Mathematics.Complex32.CommonLogarithm ( )
inline

Common Logarithm of this Complex32 (Base 10).

Returns
The common logarithm of this complex number.

Definition at line 771 of file Complex32.cs.

References BGC.Mathematics.Complex32.Log().

Referenced by BGC.Mathematics.Complex32.Cosh().

772  {
773  if (IsRealNonNegative())
774  {
775  return new Complex32(Mathf.Log10(_real), 0f);
776  }
777 
778  return new Complex32(0.5f * Mathf.Log10(MagnitudeSquared), Phase);
779  }
float Phase
Gets the phase of a complex number in radians.
Definition: Complex32.cs:142
float MagnitudeSquared
Gets the squared magnitude (or squared absolute value) of a complex number.
Definition: Complex32.cs:715
bool IsRealNonNegative()
Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0...
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Conjugate() [1/2]

static Complex32 BGC.Mathematics.Complex32.Conjugate ( in Complex32  value)
static

Computes the conjugate of a complex number and returns the result.

Referenced by BGC.Mathematics.Complex32.Atan(), and BGC.Mathematics.Fourier.BluesteinForward().

Here is the caller graph for this function:

◆ Conjugate() [2/2]

Complex32 BGC.Mathematics.Complex32.Conjugate ( )

Computes the conjugate of a complex number and returns the result.

◆ Cos()

static Complex32 BGC.Mathematics.Complex32.Cos ( in Complex32  value)
inlinestatic

Trigonometric Cosine of a Complex32 number.

Parameters
valueThe complex value.
Returns
The cosine of a complex number.

Definition at line 209 of file Complex32.cs.

References BGC.Mathematics.GeneralMath.Cosh(), and BGC.Mathematics.GeneralMath.Sinh().

Referenced by BGC.Mathematics.Complex32.Rotation().

210  {
211  if (value.IsReal())
212  {
213  return new Complex32(Mathf.Cos(value.Real), 0f);
214  }
215 
216  return new Complex32(
217  Mathf.Cos(value.Real) * GeneralMath.Cosh(value.Imaginary),
218  -Mathf.Sin(value.Real) * GeneralMath.Sinh(value.Imaginary));
219  }
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Cosh()

static Complex32 BGC.Mathematics.Complex32.Cosh ( in Complex32  value)
inlinestatic

Hyperbolic Cosine of a Complex32 number.

Parameters
valueThe complex value.
Returns
The hyperbolic cosine of a complex number.

Definition at line 227 of file Complex32.cs.

References BGC.Mathematics.Complex32.CommonLogarithm(), BGC.Mathematics.GeneralMath.Cosh(), BGC.Mathematics.Complex32.Exp(), BGC.Mathematics.Complex32.Exponential(), BGC.Mathematics.Complex32.Logarithm(), BGC.Mathematics.Complex32.NaturalLogarithm(), BGC.Mathematics.Complex32.Power(), BGC.Mathematics.Complex32.Reciprocal(), and BGC.Mathematics.GeneralMath.Sinh().

228  {
229  if (value.IsReal())
230  {
231  return new Complex32(GeneralMath.Cosh(value.Real), 0f);
232  }
233 
234  // cosh(x + j*y) = cosh(x)*cos(y) + j*sinh(x)*sin(y)
235  // if x > huge, cosh(x + j*y) = exp(|x|)/2*cos(y) + j*sign(x)*exp(|x|)/2*sin(y)
236 
237  if (Mathf.Abs(value.Real) >= 22f) // Taken from the msun library in FreeBSD
238  {
239  float h = Mathf.Exp(Mathf.Abs(value.Real)) * 0.5f;
240  return new Complex32(
241  h * Mathf.Cos(value.Imaginary),
242  Mathf.Sign(value.Real) * h * Mathf.Sin(value.Imaginary));
243  }
244 
245  return new Complex32(
246  GeneralMath.Cosh(value.Real) * Mathf.Cos(value.Imaginary),
247  GeneralMath.Sinh(value.Real) * Mathf.Sin(value.Imaginary));
248  }
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:

◆ Divide()

static Complex32 BGC.Mathematics.Complex32.Divide ( in Complex32  dividend,
in Complex32  divisor 
)
static

Divides one complex number by another and returns the result.

◆ Equals() [1/3]

bool BGC.Mathematics.Complex32.Equals ( in Complex32  value)
inline

Returns a value that indicates whether the current instance and a specified complex number have the same value.

Definition at line 477 of file Complex32.cs.

References BGC.Mathematics.GeneralMath.Approximately().

478  {
479  if (IsNaN() || value.IsNaN())
480  {
481  return false;
482  }
483 
484  if (IsInfinity() && value.IsInfinity())
485  {
486  return true;
487  }
488 
489  return GeneralMath.Approximately(_real, value._real) &&
490  GeneralMath.Approximately(_imag, value._imag);
491  }
bool IsInfinity()
Gets a value indicating whether the provided Complex32 evaluates to an infinite value.
readonly float _imag
The imaginary component of the complex number.
Definition: Complex32.cs:53
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47
bool IsNaN()
Gets a value indicating whether the provided Complex32evaluates to a value that is not a number...
Here is the call graph for this function:

◆ Equals() [2/3]

bool IEquatable<Complex32>. BGC.Mathematics.Complex32.Equals ( Complex32  other)

Returns a value that indicates whether the current instance and a specified complex number have the same value.

◆ Equals() [3/3]

override bool BGC.Mathematics.Complex32.Equals ( object  obj)

Returns a value that indicates whether the current instance and a specified object have the same value.

◆ Exp()

static Complex32 BGC.Mathematics.Complex32.Exp ( in Complex32  value)
static

Returns e raised to the power specified by a complex number.

Referenced by BGC.Mathematics.Complex32.Cosh(), BGC.Mathematics.Complex32.Exponential(), BGC.Mathematics.Complex32.Sinh(), and BGC.Mathematics.Complex32.Tanh().

Here is the caller graph for this function:

◆ Exponential()

Complex32 BGC.Mathematics.Complex32.Exponential ( )
inline

Exponential of this Complex32 (exp(x), E^x).

Returns
The exponential of this complex number.

Definition at line 793 of file Complex32.cs.

References BGC.Mathematics.Complex32._real, and BGC.Mathematics.Complex32.Exp().

Referenced by BGC.Mathematics.Complex32.Cosh().

794  {
795  float exp = Mathf.Exp(_real);
796  if (IsReal())
797  {
798  return new Complex32(exp, 0f);
799  }
800 
801  return new Complex32(exp * Mathf.Cos(_imag), exp * Mathf.Sin(_imag));
802  }
bool IsReal()
Gets a value indicating whether the provided Complex32 is real.
readonly float _imag
The imaginary component of the complex number.
Definition: Complex32.cs:53
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromPolarCoordinates() [1/2]

static Complex32 BGC.Mathematics.Complex32.FromPolarCoordinates ( float  magnitude,
float  phase 
)
static

Creates a complex number from a point's polar coordinates.

◆ FromPolarCoordinates() [2/2]

static Complex32 BGC.Mathematics.Complex32.FromPolarCoordinates ( double  magnitude,
double  phase 
)
static

Creates a complex number from a point's polar coordinates.

◆ GetHashCode()

override int BGC.Mathematics.Complex32.GetHashCode ( )
inline

Returns the hash code for the current Complex32 object.

Definition at line 506 of file Complex32.cs.

507  {
508  int hash = 27;
509  hash = (13 * hash) + _real.GetHashCode();
510  hash = (13 * hash) + _imag.GetHashCode();
511  return hash;
512  }
readonly float _imag
The imaginary component of the complex number.
Definition: Complex32.cs:53
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47

◆ InternalDiv()

static Complex32 BGC.Mathematics.Complex32.InternalDiv ( float  a,
float  b,
float  c,
float  d,
bool  swapped 
)
inlinestaticprivate

Helper method for dividing.

Parameters
aRe first
bIm first
cRe second
dIm second

Definition at line 875 of file Complex32.cs.

876  {
877  float r = d / c;
878  float t = 1 / (c + d * r);
879  float e, f;
880 
881  if (r != 0f) // one can use r >= float.Epsilon || r <= float.Epsilon instead
882  {
883  e = (a + b * r) * t;
884  f = (b - a * r) * t;
885  }
886  else
887  {
888  e = (a + d * (b / c)) * t;
889  f = (b - d * (a / c)) * t;
890  }
891 
892  if (swapped)
893  {
894  f = -f;
895  }
896 
897  return new Complex32(e, f);
898  }
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84

◆ IsImaginaryOne()

bool BGC.Mathematics.Complex32.IsImaginaryOne ( )

Gets a value indicating whether the Complex32 is the imaginary unit.

Returns
true if this instance is ImaginaryOne; otherwise, false.

◆ IsInfinity()

bool BGC.Mathematics.Complex32.IsInfinity ( )

Gets a value indicating whether the provided Complex32 evaluates to an infinite value.

Returns
true if this instance is infinite; otherwise, false.

True if it either evaluates to a complex infinity or to a directed infinity.

◆ IsNaN()

bool BGC.Mathematics.Complex32.IsNaN ( )

Gets a value indicating whether the provided Complex32evaluates to a value that is not a number.

Returns
true if this instance is NaN; otherwise, false.

◆ IsOne()

bool BGC.Mathematics.Complex32.IsOne ( )

Gets a value indicating whether the Complex32 is one.

Returns
true if this instance is one; otherwise, false.

◆ IsReal()

bool BGC.Mathematics.Complex32.IsReal ( )

Gets a value indicating whether the provided Complex32 is real.

Returns
true if this instance is a real number; otherwise, false.

◆ IsRealNonNegative()

bool BGC.Mathematics.Complex32.IsRealNonNegative ( )

Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0.

Returns
true if this instance is real nonnegative number; otherwise, false.

◆ IsZero()

bool BGC.Mathematics.Complex32.IsZero ( )

Gets a value indicating whether the Complex32 is zero.

Returns
true if this instance is zero; otherwise, false.

◆ Log() [1/2]

static Complex32 BGC.Mathematics.Complex32.Log ( in Complex32  value)
static

Returns the natural (base e) logarithm of a specified complex number.

Referenced by BGC.Mathematics.Complex32.CommonLogarithm().

Here is the caller graph for this function:

◆ Log() [2/2]

static Complex32 BGC.Mathematics.Complex32.Log ( in Complex32  value,
float  baseValue 
)
static

Returns the logarithm of a specified complex number in a specified base.

◆ Log10()

static Complex32 BGC.Mathematics.Complex32.Log10 ( in Complex32  value)
static

Returns the base-10 logarithm of a specified complex number.

◆ Logarithm()

Complex32 BGC.Mathematics.Complex32.Logarithm ( float  baseValue)

Logarithm of this Complex32 with custom base.

Returns
The logarithm of this complex number.

Referenced by BGC.Mathematics.Complex32.Cosh().

Here is the caller graph for this function:

◆ Multiply()

static Complex32 BGC.Mathematics.Complex32.Multiply ( in Complex32  left,
in Complex32  right 
)
static

Returns the product of two complex numbers.

◆ NaturalLogarithm()

Complex32 BGC.Mathematics.Complex32.NaturalLogarithm ( )
inline

Natural Logarithm of this Complex32 (Base E).

Returns
The natural logarithm of this complex number.

Definition at line 757 of file Complex32.cs.

Referenced by BGC.Mathematics.Complex32.Cosh().

758  {
759  if (IsRealNonNegative())
760  {
761  return new Complex32(Mathf.Log(_real), 0f);
762  }
763 
764  return new Complex32(0.5f * Mathf.Log(MagnitudeSquared), Phase);
765  }
float Phase
Gets the phase of a complex number in radians.
Definition: Complex32.cs:142
float MagnitudeSquared
Gets the squared magnitude (or squared absolute value) of a complex number.
Definition: Complex32.cs:715
bool IsRealNonNegative()
Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0...
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the caller graph for this function:

◆ Negate()

static Complex32 BGC.Mathematics.Complex32.Negate ( in Complex32  value)
static

Returns the additive inverse of a specified complex number.

◆ operator Complex32() [1/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( byte  value)
static

Defines an implicit conversion of an unsigned byte to a complex number.

◆ operator Complex32() [2/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( float  value)
static

Defines an implicit conversion of a single-precision floating-point number to a complex number.

◆ operator Complex32() [3/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( double  value)
static

Defines an implicit conversion of a double-precision floating-point number to a complex number.

Parameters
value

◆ operator Complex32() [4/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( sbyte  value)
static

Defines an implicit conversion of a signed byte to a complex number.

◆ operator Complex32() [5/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( ulong  value)
static

Defines an implicit conversion of a 64-bit unsigned integer to a complex number.

◆ operator Complex32() [6/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( uint  value)
static

Defines an implicit conversion of a 32-bit unsigned integer to a complex number.

◆ operator Complex32() [7/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( ushort  value)
static

Defines an implicit conversion of a 16-bit unsigned integer to a complex number.

◆ operator Complex32() [8/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( long  value)
static

Defines an implicit conversion of a 64-bit signed integer to a complex number.

◆ operator Complex32() [9/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( int  value)
static

Defines an implicit conversion of a 32-bit signed integer to a complex number.

◆ operator Complex32() [10/11]

static implicit BGC.Mathematics.Complex32.operator Complex32 ( short  value)
static

Defines an implicit conversion of a 16-bit signed integer to a complex number.

◆ operator Complex32() [11/11]

static BGC.Mathematics.Complex32.operator Complex32 ( decimal  value)
explicitstatic

Defines an explicit conversion of a System.Decimal value to a complex number.

◆ operator!=()

static bool BGC.Mathematics.Complex32.operator!= ( in Complex32  left,
in Complex32  right 
)
static

Returns a value that indicates whether two complex numbers are not equal.

◆ operator*()

static Complex32 BGC.Mathematics.Complex32.operator* ( in Complex32  left,
in Complex32  right 
)
static

Multiplies two specified complex numbers.

◆ operator+()

static Complex32 BGC.Mathematics.Complex32.operator+ ( in Complex32  left,
in Complex32  right 
)
static

Adds two complex numbers.

◆ operator-() [1/2]

static Complex32 BGC.Mathematics.Complex32.operator- ( in Complex32  value)
static

Returns the additive inverse of a specified complex number.

◆ operator-() [2/2]

static Complex32 BGC.Mathematics.Complex32.operator- ( in Complex32  left,
in Complex32  right 
)
static

Subtracts a complex number from another complex number.

◆ operator/()

static Complex32 BGC.Mathematics.Complex32.operator/ ( in Complex32  dividend,
in Complex32  divisor 
)
inlinestatic

Divides a specified complex number by another specified complex number.

Definition at line 566 of file Complex32.cs.

References BGC.Mathematics.Complex32.Real.

567  {
568  if (dividend.IsZero() && divisor.IsZero())
569  {
570  return NaN;
571  }
572 
573  if (divisor.IsZero())
574  {
575  return PositiveInfinity;
576  }
577 
578  float a = dividend.Real;
579  float b = dividend.Imaginary;
580  float c = divisor.Real;
581  float d = divisor.Imaginary;
582  if (Mathf.Abs(d) <= Mathf.Abs(c))
583  {
584  return InternalDiv(a, b, c, d, false);
585  }
586 
587  return InternalDiv(b, a, d, c, true);
588  }
float Real
Gets the real component of the current System.Numerics.Complex32 object.
Definition: Complex32.cs:98
static readonly Complex32 PositiveInfinity
Returns a new Complex32 instance with real and imaginary numbers positive infinite.
Definition: Complex32.cs:74
static readonly Complex32 NaN
Returns a new Complex32 instance with real and imaginary numbers not a number.
Definition: Complex32.cs:79
static Complex32 InternalDiv(float a, float b, float c, float d, bool swapped)
Helper method for dividing.
Definition: Complex32.cs:875

◆ operator==()

static bool BGC.Mathematics.Complex32.operator== ( in Complex32  left,
in Complex32  right 
)
static

Returns a value that indicates whether two complex numbers are equal.

◆ Pow() [1/2]

static Complex32 BGC.Mathematics.Complex32.Pow ( in Complex32  value,
float  power 
)
static

Returns a specified complex number raised to a power specified by a float-precision floating-point number.

◆ Pow() [2/2]

static Complex32 BGC.Mathematics.Complex32.Pow ( in Complex32  value,
in Complex32  power 
)
static

Returns a specified complex number raised to a power specified by a complex number.

◆ Power()

Complex32 BGC.Mathematics.Complex32.Power ( in Complex32  exponent)
inline

Raise this Complex32 to the given value.

Parameters
exponentThe exponent.
Returns
The complex number raised to the given exponent.

Definition at line 726 of file Complex32.cs.

References BGC.Mathematics.Complex32.Imaginary.

Referenced by BGC.Mathematics.Complex32.Cosh().

727  {
728  if (IsZero())
729  {
730  if (exponent.IsZero())
731  {
732  return One;
733  }
734 
735  if (exponent.Real > 0f)
736  {
737  return Zero;
738  }
739 
740  if (exponent.Real < 0f)
741  {
742  return exponent.Imaginary == 0f
743  ? new Complex32(float.PositiveInfinity, 0f)
744  : new Complex32(float.PositiveInfinity, float.PositiveInfinity);
745  }
746 
747  return NaN;
748  }
749 
750  return (exponent * NaturalLogarithm()).Exponential();
751  }
static readonly Complex32 PositiveInfinity
Returns a new Complex32 instance with real and imaginary numbers positive infinite.
Definition: Complex32.cs:74
Complex32 NaturalLogarithm()
Natural Logarithm of this Complex32 (Base E).
Definition: Complex32.cs:757
bool IsZero()
Gets a value indicating whether the Complex32 is zero.
static readonly Complex32 One
Returns a new Complex32 instance with a real number equal to one and an imaginary number equal to zer...
Definition: Complex32.cs:64
Complex32 Exponential()
Exponential of this Complex32 (exp(x), E^x).
Definition: Complex32.cs:793
static readonly Complex32 Zero
Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to ze...
Definition: Complex32.cs:59
static readonly Complex32 NaN
Returns a new Complex32 instance with real and imaginary numbers not a number.
Definition: Complex32.cs:79
float Imaginary
Gets the imaginary component of the current System.Numerics.Complex32 object.
Definition: Complex32.cs:93
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the caller graph for this function:

◆ RealProduct()

float BGC.Mathematics.Complex32.RealProduct ( in Complex32  other)

Returns the real component of the product of this Complex32 with other.

Returns
The real component of the product.

◆ RealRotation()

float BGC.Mathematics.Complex32.RealRotation ( float  phase)

Retuns the real value of the Complex32 number after rotation by phase radians, or exp(i*phase)

◆ Reciprocal() [1/2]

static Complex32 BGC.Mathematics.Complex32.Reciprocal ( in Complex32  value)
static

Returns the multiplicative inverse of a complex number.

Referenced by BGC.Mathematics.Complex32.Cosh().

Here is the caller graph for this function:

◆ Reciprocal() [2/2]

Complex32 BGC.Mathematics.Complex32.Reciprocal ( )

Returns the multiplicative inverse of a complex number.

◆ Rotation()

Complex32 BGC.Mathematics.Complex32.Rotation ( float  phase)
inline

Retuns the Complex32 number, rotated by phase radians, or exp(i*phase)

Definition at line 459 of file Complex32.cs.

References BGC.Mathematics.Complex32.Cos(), and BGC.Mathematics.Complex32.Sin().

460  {
461  float cosPhase = Mathf.Cos(phase);
462  float sinePhase = Mathf.Sin(phase);
463  return new Complex32(
464  _real * cosPhase - _imag * sinePhase,
465  _real * sinePhase + _imag * cosPhase);
466  }
readonly float _imag
The imaginary component of the complex number.
Definition: Complex32.cs:53
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:

◆ Sin()

static Complex32 BGC.Mathematics.Complex32.Sin ( in Complex32  value)
inlinestatic

Trigonometric Sine of a Complex32 number.

Parameters
valueThe complex value.
Returns
The sine of the complex number.

Definition at line 318 of file Complex32.cs.

References BGC.Mathematics.GeneralMath.Cosh(), and BGC.Mathematics.GeneralMath.Sinh().

Referenced by BGC.Mathematics.Complex32.Rotation().

319  {
320  if (value.IsReal())
321  {
322  return new Complex32(Mathf.Sin(value.Real), 0f);
323  }
324 
325  return new Complex32(
326  Mathf.Sin(value.Real) * GeneralMath.Cosh(value.Imaginary),
327  Mathf.Cos(value.Real) * GeneralMath.Sinh(value.Imaginary));
328  }
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sinh()

static Complex32 BGC.Mathematics.Complex32.Sinh ( in Complex32  value)
inlinestatic

Hyperbolic Sine of a Complex32 number.

Parameters
valueThe complex value.
Returns
The hyperbolic sine of a complex number.

Definition at line 336 of file Complex32.cs.

References BGC.Mathematics.GeneralMath.Cosh(), BGC.Mathematics.Complex32.Exp(), and BGC.Mathematics.GeneralMath.Sinh().

337  {
338  if (value.IsReal())
339  {
340  return new Complex32(GeneralMath.Sinh(value.Real), 0f);
341  }
342 
343  // sinh(x + j y) = sinh(x)*cos(y) + j*cosh(x)*sin(y)
344  // if x > huge, sinh(x + jy) = sign(x)*exp(|x|)/2*cos(y) + j*exp(|x|)/2*sin(y)
345 
346  if (Mathf.Abs(value.Real) >= 22f) // Taken from the msun library in FreeBSD
347  {
348  float h = Mathf.Exp(Mathf.Abs(value.Real)) * 0.5f;
349  return new Complex32(
350  Mathf.Sign(value.Real) * h * Mathf.Cos(value.Imaginary),
351  h * Mathf.Sin(value.Imaginary));
352  }
353 
354  return new Complex32(
355  GeneralMath.Sinh(value.Real) * Mathf.Cos(value.Imaginary),
356  GeneralMath.Cosh(value.Real) * Mathf.Sin(value.Imaginary));
357  }
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:

◆ Sqrt()

static Complex32 BGC.Mathematics.Complex32.Sqrt ( in Complex32  value)
static

The Square Root of a complex number

◆ Square()

Complex32 BGC.Mathematics.Complex32.Square ( )
inline

The Square (power 2) of this Complex32

Returns
The square of this complex number.

Definition at line 365 of file Complex32.cs.

References BGC.Mathematics.Complex32.SquareRoot().

366  {
367  if (IsReal())
368  {
369  return new Complex32(_real * _real, 0.0f);
370  }
371 
372  return new Complex32((_real * _real) - (_imag * _imag), 2 * _real * _imag);
373  }
bool IsReal()
Gets a value indicating whether the provided Complex32 is real.
readonly float _imag
The imaginary component of the complex number.
Definition: Complex32.cs:53
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:

◆ SquareRoot()

Complex32 BGC.Mathematics.Complex32.SquareRoot ( )
inline

The Square Root (power 1/2) of this Complex32

Returns
The square root of this complex number.

Definition at line 829 of file Complex32.cs.

References BGC.Mathematics.Complex32.Abs().

Referenced by BGC.Mathematics.Complex32.Square().

830  {
831  if (IsRealNonNegative())
832  {
833  return new Complex32(Mathf.Sqrt(_real), 0f);
834  }
835 
836  Complex32 result;
837 
838  float absReal = Mathf.Abs(Real);
839  float absImag = Mathf.Abs(Imaginary);
840  float w;
841  if (absReal >= absImag)
842  {
843  float ratio = Imaginary / Real;
844  w = Mathf.Sqrt(absReal) * Mathf.Sqrt(0.5f * (1f + Mathf.Sqrt(1f + (ratio * ratio))));
845  }
846  else
847  {
848  float ratio = Real / Imaginary;
849  w = Mathf.Sqrt(absImag) * Mathf.Sqrt(0.5f * (Mathf.Abs(ratio) + Mathf.Sqrt(1f + (ratio * ratio))));
850  }
851 
852  if (Real >= 0f)
853  {
854  result = new Complex32(w, (Imaginary / (2f * w)));
855  }
856  else if (Imaginary >= 0f)
857  {
858  result = new Complex32((absImag / (2f * w)), w);
859  }
860  else
861  {
862  result = new Complex32((absImag / (2f * w)), -w);
863  }
864 
865  return result;
866  }
float Real
Gets the real component of the current System.Numerics.Complex32 object.
Definition: Complex32.cs:98
bool IsRealNonNegative()
Gets a value indicating whether the provided Complex32 is real and not negative, that is >= 0...
float Imaginary
Gets the imaginary component of the current System.Numerics.Complex32 object.
Definition: Complex32.cs:93
readonly float _real
The real component of the complex number.
Definition: Complex32.cs:47
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Subtract()

static Complex32 BGC.Mathematics.Complex32.Subtract ( in Complex32  left,
Complex32  right 
)
static

The difference between two Complex32 numbers;

Returns
The complex difference.

◆ Tan()

static Complex32 BGC.Mathematics.Complex32.Tan ( in Complex32  value)
inlinestatic

Trigonometric Tangent of a Complex32 number.

Parameters
valueThe complex value.
Returns
The tangent of the complex number.

Definition at line 394 of file Complex32.cs.

Referenced by BGC.Mathematics.Complex32.Tanh().

395  {
396  if (value.IsReal())
397  {
398  return new Complex32(Mathf.Tan(value.Real), 0f);
399  }
400 
401  // tan(z) = - j*tanh(j*z)
402 
403  Complex32 z = Tanh(new Complex32(-value.Imaginary, value.Real));
404  return new Complex32(z.Imaginary, -z.Real);
405  }
static Complex32 Tanh(in Complex32 value)
Hyperbolic Tangent of a Complex32 number.
Definition: Complex32.cs:413
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the caller graph for this function:

◆ Tanh()

static Complex32 BGC.Mathematics.Complex32.Tanh ( in Complex32  value)
inlinestatic

Hyperbolic Tangent of a Complex32 number.

Parameters
valueThe complex value.
Returns
The hyperbolic tangent of a complex number.

Definition at line 413 of file Complex32.cs.

References BGC.Mathematics.GeneralMath.Cosh(), BGC.Mathematics.Complex32.Exp(), BGC.Mathematics.GeneralMath.Sinh(), BGC.Mathematics.Complex32.Tan(), and BGC.Mathematics.GeneralMath.Tanh().

414  {
415  if (value.IsReal())
416  {
417  return new Complex32(GeneralMath.Tanh(value.Real), 0f);
418  }
419 
420  // tanh(x + j*y) = (cosh(x)*sinh(x)/cos^2(y) + j*tan(y))/(1 + sinh^2(x)/cos^2(y))
421  // if |x| > huge, tanh(z) = sign(x) + j*4*cos(y)*sin(y)*exp(-2*|x|)
422  // if exp(-|x|) = 0, tanh(z) = sign(x)
423  // if tan(y) = +/- oo or 1/cos^2(y) = 1 + tan^2(y) = oo, tanh(z) = cosh(x)/sinh(x)
424  //
425  // The algorithm is based on Kahan.
426 
427  if (Math.Abs(value.Real) >= 22f) // Taken from the msun library in FreeBSD
428  {
429  float e = Mathf.Exp(-Mathf.Abs(value.Real));
430  if (e == 0f)
431  {
432  return new Complex32(Mathf.Sign(value.Real), 0f);
433  }
434  else
435  {
436  return new Complex32(
437  Mathf.Sign(value.Real),
438  4f * Mathf.Cos(value.Imaginary) * Mathf.Sin(value.Imaginary) * e * e);
439  }
440  }
441 
442  float tani = Mathf.Tan(value.Imaginary);
443  float beta = 1 + tani * tani; // beta = 1/cos^2(y) = 1 + t^2
444  float sinhr = GeneralMath.Sinh(value.Real);
445  float coshr = GeneralMath.Cosh(value.Real);
446 
447  if (float.IsInfinity(tani))
448  {
449  return new Complex32(coshr / sinhr, 0f);
450  }
451 
452  float denom = 1f + beta * sinhr * sinhr;
453  return new Complex32(beta * coshr * sinhr / denom, tani / denom);
454  }
bool IsInfinity()
Gets a value indicating whether the provided Complex32 evaluates to an infinite value.
Complex32(float real, float imaginary)
Initializes a new Complex32 structure using the specified real and imaginary values.
Definition: Complex32.cs:84
Here is the call graph for this function:

◆ ToString() [1/4]

string BGC.Mathematics.Complex32.ToString ( string  format)

Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format for its real and imaginary parts.

◆ ToString() [2/4]

string BGC.Mathematics.Complex32.ToString ( IFormatProvider  provider)

Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified culture-specific formatting information.

◆ ToString() [3/4]

string BGC.Mathematics.Complex32.ToString ( string  format,
IFormatProvider  provider 
)

Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format and culture-specific format information for its real and imaginary parts.

◆ ToString() [4/4]

override string BGC.Mathematics.Complex32.ToString ( )

Converts the value of the current complex number to its equivalent string representation in Cartesian form.

Returns

Field Documentation

◆ _imag

readonly float BGC.Mathematics.Complex32._imag
private

The imaginary component of the complex number.

Definition at line 53 of file Complex32.cs.

◆ _real

readonly float BGC.Mathematics.Complex32._real
private

The real component of the complex number.

Definition at line 47 of file Complex32.cs.

Referenced by BGC.Mathematics.Complex32.Exponential().

◆ Imaginary

float BGC.Mathematics.Complex32.Imaginary => _imag

Gets the imaginary component of the current System.Numerics.Complex32 object.

Definition at line 93 of file Complex32.cs.

Referenced by BGC.Mathematics.Complex64.operator/(), and BGC.Mathematics.Complex32.Power().

◆ ImaginaryOne

readonly Complex32 BGC.Mathematics.Complex32.ImaginaryOne = new Complex32(0f, 1f)
static

Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to one.

Definition at line 69 of file Complex32.cs.

◆ MagnitudeSquared

float BGC.Mathematics.Complex32.MagnitudeSquared => (_real * _real) + (_imag * _imag)

Gets the squared magnitude (or squared absolute value) of a complex number.

Returns
The squared magnitude of the current instance.

Definition at line 715 of file Complex32.cs.

◆ NaN

readonly Complex32 BGC.Mathematics.Complex32.NaN = new Complex32(float.NaN, float.NaN)
static

Returns a new Complex32 instance with real and imaginary numbers not a number.

Definition at line 79 of file Complex32.cs.

◆ One

readonly Complex32 BGC.Mathematics.Complex32.One = new Complex32(1f, 0f)
static

Returns a new Complex32 instance with a real number equal to one and an imaginary number equal to zero.

Definition at line 64 of file Complex32.cs.

◆ Phase

float BGC.Mathematics.Complex32.Phase => _imag == 0f && _real < 0f ? Mathf.PI : Mathf.Atan2(_imag, _real)

Gets the phase of a complex number in radians.

Definition at line 142 of file Complex32.cs.

◆ PositiveInfinity

readonly Complex32 BGC.Mathematics.Complex32.PositiveInfinity = new Complex32(float.PositiveInfinity, float.PositiveInfinity)
static

Returns a new Complex32 instance with real and imaginary numbers positive infinite.

Definition at line 74 of file Complex32.cs.

◆ Real

float BGC.Mathematics.Complex32.Real => _real

Gets the real component of the current System.Numerics.Complex32 object.

Definition at line 98 of file Complex32.cs.

Referenced by BGC.Mathematics.Complex64.operator/(), and BGC.Mathematics.Complex32.operator/().

◆ Zero

readonly Complex32 BGC.Mathematics.Complex32.Zero = new Complex32(0f, 0f)
static

Returns a new Complex32 instance with a real number equal to zero and an imaginary number equal to zero.

Definition at line 59 of file Complex32.cs.

Property Documentation

◆ Magnitude

float BGC.Mathematics.Complex32.Magnitude
get

Gets the magnitude (or absolute value) of a complex number.

Definition at line 104 of file Complex32.cs.


The documentation for this struct was generated from the following file: