Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
Vector3C Struct Reference

This class defines 3-dimensional vectors of complex numbers. The class saves the x,y and z coordinates. More...

Inheritance diagram for Vector3C:

Public Member Functions

double Abs ()
 Calculates the absolute value of this Vector3C object. The absolute value is defined as the square root of Norm().
 
Complex ComplexAbs ()
 Calculates the complex Norm of the Vector3C object.
 
bool IsRealVector ()
 Determines whether this vector is a pure real one, i.e. all imaginary parts are zero.
 
double Norm ()
 Calculates the norm of the present Vector3C object. The norm is defined as (X * Complex.Conjugate(X) + Y * Complex.Conjugate(Y) + Z * Complex.Conjugate(Z)).Re which is equal to the sum of the norms of the vector components.
 
void Normalize ()
 Normalizes the present Vector3C object.
 
override string ToString ()
 Converts a Vector3C into a string of format (X.Re + iX.Im;Y.Re + iY.Im;Z.Re + iZ.Im).
 
 Vector3C (Complex x, Complex y, Complex z)
 Creates a Vector3C from three double values.
 
 Vector3C (Vector3C vec)
 Creates a new Vector3C object from an existing object.
 

Static Public Member Functions

static Vector3C CrossProduct (Vector3C a, Vector3C b)
 Calculates the cross product of two Vector3C objects.
 
static implicit operator Vector3C (Vector3D vector3D)
 Converts a Vector3D object into a Vector3C object.
 
static bool operator!= (Vector3C vector1, Vector3C vector2)
 Compares two Vector3C for inequality. The comparison will be done by comparing the values of the two x-, y- and z- components respectively.
 
static Vector3C operator* (Complex factor, Vector3C vector)
 Multiplies a Vector3C objects with a Complex value.
 
static Vector3C operator* (Vector3C a, Vector3C b)
 Multiplies two Vector3C objects.
 
static Vector3C operator* (Vector3C vector, Complex factor)
 Multiplies a Vector3C object with a Complex value.
 
static Vector3C operator+ (Vector3C a, Vector3C b)
 Adds two Vector3C objects.
 
static Vector3C operator- (Vector3C a, Vector3C b)
 Subtracts two Vector3C objects.
 
static Vector3C operator/ (Complex number, Vector3C vector)
 Performs a component wise division of a double value and a Vector3C object. The result is defined as new Vector3C(number / vector.X, number / vector.Y).
 
static Vector3C operator/ (Vector3C a, Vector3C b)
 Performs a component wise division of two Vector3C objects.
 
static Vector3C operator/ (Vector3C vector, Complex divisor)
 Performs a component wise division of a Vector3C object and a Complex value.
 
static bool operator== (Vector3C vector1, Vector3C vector2)
 Compares two Vector3C for equality. The comparison will be done by comparing the values of the two x-, y- and z- components respectively.
 
static Complex operator| (Vector3C a, Vector3C b)
 Calculates the scalar product of two Vector3C objects. The scalar product is defined as a.X * b.X + a.Y * b.Y + a.Z * b.Z.
 

Public Attributes

Complex X
 X value of the Vector3C object.
 
Complex Y
 Y value of the Vector3C object.
 
Complex Z
 Z value of the Vector3C object.
 

Static Public Attributes

static readonly Vector3C UnitVectorX
 A constant containing the unit vector in x-direction.
 
static readonly Vector3C UnitVectorY
 A constant containing the unit vector in y-direction.
 
static readonly Vector3C UnitVectorZ
 A constant containing the unit vector in z-direction.
 
static readonly Vector3C ZeroVector
 A constant containing the zero vector (0, 0).
 

Properties

Vector3D Im [get, set]
 Sets or gets a Vector3D object containing the the imaginary part of the x-, y- and z- components of the present Vector3C object. If an Vector3D object is set then the real parts of all components is not influences.
 
bool IsUndefined [get]
 Gets whether a least one component of the vector is undefined.
 
Vector3D Re [get, set]
 Sets or gets a Vector3D object containing the the real part of the x-, y- and z- components of the present Vector3C object. If an Vector3D object is set then the imaginary parts of all components is not influences.
 

Detailed Description

This class defines 3-dimensional vectors of complex numbers. The class saves the x,y and z coordinates.

Constructor & Destructor Documentation

◆ Vector3C() [1/2]

Vector3C ( Complex  x,
Complex  y,
Complex  z 
)

Creates a Vector3C from three double values.

Parameters
xX value of new Vector3C object.
yY value of new Vector3C object.
zZ value of new Vector3C object.

◆ Vector3C() [2/2]

Vector3C ( Vector3C  vec)

Creates a new Vector3C object from an existing object.

Parameters
vecVector3C object to copy.

Member Function Documentation

◆ Abs()

double Abs ( )

Calculates the absolute value of this Vector3C object. The absolute value is defined as the square root of Norm().

Returns
The absolute value of the Vector3C.

◆ ComplexAbs()

Complex ComplexAbs ( )

Calculates the complex Norm of the Vector3C object.

Returns
the norm of the vector

◆ CrossProduct()

static Vector3C CrossProduct ( Vector3C  a,
Vector3C  b 
)
static

Calculates the cross product of two Vector3C objects.

Parameters
aFirst operant used for cross product calculation.
bSecond operant used for cross product calculation.
Returns
A Vector3C object containing the cross product

◆ IsRealVector()

bool IsRealVector ( )

Determines whether this vector is a pure real one, i.e. all imaginary parts are zero.

Returns
True iff the imaginary parts of all vector components are zero.

◆ Norm()

double Norm ( )

Calculates the norm of the present Vector3C object. The norm is defined as (X * Complex.Conjugate(X) + Y * Complex.Conjugate(Y) + Z * Complex.Conjugate(Z)).Re which is equal to the sum of the norms of the vector components.

Returns
The norm of the Vector3C object.

◆ operator Vector3C()

static implicit operator Vector3C ( Vector3D  vector3D)
static

Converts a Vector3D object into a Vector3C object.

Parameters
vector3DVector3D object to convert into Vector3C object.
Returns
The converted Vector3C object.

◆ operator!=()

static bool operator!= ( Vector3C  vector1,
Vector3C  vector2 
)
static

Compares two Vector3C for inequality. The comparison will be done by comparing the values of the two x-, y- and z- components respectively.

Parameters
vector1First Vector3C object to compare.
vector2Second Vector3C object to compare.
Returns
Returns true if the two objects are unequal.

◆ operator*() [1/3]

static Vector3C operator* ( Complex  factor,
Vector3C  vector 
)
static

Multiplies a Vector3C objects with a Complex value.

Parameters
factorThe Complex value to multiply.
vectorThe Vector3C object to multiply.
Returns
Returns the product of the Vector3C object and the Complex value.

◆ operator*() [2/3]

static Vector3C operator* ( Vector3C  a,
Vector3C  b 
)
static

Multiplies two Vector3C objects.

Parameters
aThe first Vector3C object to multiply.
bThe second Vector3C object to multiply.
Returns
Returns the product of the two Vector3C objects.

◆ operator*() [3/3]

static Vector3C operator* ( Vector3C  vector,
Complex  factor 
)
static

Multiplies a Vector3C object with a Complex value.

Parameters
vectorThe Vector3C object to multiply.
factorThe Complex value to multiply.
Returns
Returns the product of the Vector3C object and the Complex value.

◆ operator+()

static Vector3C operator+ ( Vector3C  a,
Vector3C  b 
)
static

Adds two Vector3C objects.

Parameters
aThe first Vector3C object to add.
bThe second Vector3C object to add.
Returns
Returns the sum of the two Vector3C objects.

◆ operator-()

static Vector3C operator- ( Vector3C  a,
Vector3C  b 
)
static

Subtracts two Vector3C objects.

Parameters
aThe first Vector3C object to subtract from.
bThe second Vector3C object to subtract.
Returns
Returns the difference of the two Vector3C objects.

◆ operator/() [1/3]

static Vector3C operator/ ( Complex  number,
Vector3C  vector 
)
static

Performs a component wise division of a double value and a Vector3C object. The result is defined as new Vector3C(number / vector.X, number / vector.Y).

Parameters
numberThe double value to divide by the components of the Vector3C object.
vectorThe Vector3C object used as divisor.
Returns
Returns the quotient of the double value and the Vector3C object.

◆ operator/() [2/3]

static Vector3C operator/ ( Vector3C  a,
Vector3C  b 
)
static

Performs a component wise division of two Vector3C objects.

Parameters
aThe first Vector3C object to divide by parameter b.
bThe second Vector3C object used as divisor.
Returns
Returns the quotient of the two Vector3C objects.

◆ operator/() [3/3]

static Vector3C operator/ ( Vector3C  vector,
Complex  divisor 
)
static

Performs a component wise division of a Vector3C object and a Complex value.

Parameters
vectorThe Vector3C object to divide by the Complex value.
divisorThe Complex value used as divisor.
Returns
Returns the quotient of the Vector3C object and the Complex value.

◆ operator==()

static bool operator== ( Vector3C  vector1,
Vector3C  vector2 
)
static

Compares two Vector3C for equality. The comparison will be done by comparing the values of the two x-, y- and z- components respectively.

Parameters
vector1First Vector3C object to compare.
vector2Second Vector3C object to compare.
Returns
Returns true if the two objects are equal.

◆ operator|()

static Complex operator| ( Vector3C  a,
Vector3C  b 
)
static

Calculates the scalar product of two Vector3C objects. The scalar product is defined as a.X * b.X + a.Y * b.Y + a.Z * b.Z.

Parameters
aFirst Vector3C object.
bSecond Vector3C object.
Returns
Scalar product of the two Vector3C objects.

◆ ToString()

override string ToString ( )

Converts a Vector3C into a string of format (X.Re + iX.Im;Y.Re + iY.Im;Z.Re + iZ.Im).

Returns
String containing the Vector3C information.

Property Documentation

◆ IsUndefined

bool IsUndefined
get

Gets whether a least one component of the vector is undefined.

Returns
true iff at least one component of the vector is NaN.