Table of Contents

Struct Vector3C

Namespace
VirtualLabAPI.Core.Numerics
Assembly
VirtualLabAPI.dll

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

public struct Vector3C
Inherited Members

Constructors

Vector3C(Complex, Complex, Complex)

Creates a Vector3C from three Complex values.

public Vector3C(Complex x, Complex y, Complex z)

Parameters

x Complex

x-value of new Vector3C object.

y Complex

y-value of new Vector3C object.

z Complex

z-value of new Vector3C object.

Vector3C(Vector3C)

Copy constructor.

public Vector3C(Vector3C vec)

Parameters

vec Vector3C

Vector3C object to copy.

Fields

UnitVectorX

A constant containing the unit vector in x-direction.

public static readonly Vector3C UnitVectorX

Field Value

Vector3C

UnitVectorY

A constant containing the unit vector in y-direction.

public static readonly Vector3C UnitVectorY

Field Value

Vector3C

UnitVectorZ

A constant containing the unit vector in z-direction.

public static readonly Vector3C UnitVectorZ

Field Value

Vector3C

X

x-value of the Vector3C object.

public Complex X

Field Value

Complex

Y

y-value of the Vector3C object.

public Complex Y

Field Value

Complex

Z

z-value of the Vector3C object.

public Complex Z

Field Value

Complex

ZeroVector

A constant containing the zero vector (0, 0).

public static readonly Vector3C ZeroVector

Field Value

Vector3C

Properties

Im

Sets or gets a Vector3D object containing the imaginary part of the x-, y- and z- components of this Vector3C object.

public Vector3D Im { get; set; }

Property Value

Vector3D

IsUndefined

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

public bool IsUndefined { get; }

Property Value

bool

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

Re

Sets or gets a Vector3D object containing the real part of the x-, y- and z- components of this Vector3C object.

public Vector3D Re { get; set; }

Property Value

Vector3D

Methods

Abs()

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

public double Abs()

Returns

double

The absolute value of the Vector3C.

ComplexAbs()

Calculates the complex absolute value of the Vector3C object.

public Complex ComplexAbs()

Returns

Complex

The complex absolute value of the vector.

CrossProduct(Vector3C, Vector3C)

Calculates the cross product of two Vector3C objects.

public static Vector3C CrossProduct(Vector3C a, Vector3C b)

Parameters

a Vector3C

First operant used for cross product calculation.

b Vector3C

Second operant used for cross product calculation.

Returns

Vector3C

A Vector3C object containing the cross product.

Equals(object)

This function compares the values of this vector and the vector given as parameter object for equality.

public override bool Equals(object vector3C)

Parameters

vector3C object

Vector3C to be compared.

Returns

bool

Returns true if both object pointers are equal.

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

IsRealVector()

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

public bool IsRealVector()

Returns

bool

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

Norm()

Calculates the norm of this 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.

public double Norm()

Returns

double

The norm of the Vector3C object.

Normalize()

Normalizes this Vector3C object.

public void Normalize()

ToString()

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

public override string ToString()

Returns

string

String containing the Vector3C information.

Operators

operator +(Vector3C, Vector3C)

Adds two Vector3C objects.

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

Parameters

a Vector3C

The first Vector3C object to add.

b Vector3C

The second Vector3C object to add.

Returns

Vector3C

Returns the sum of the two Vector3C objects.

operator |(Vector3C, Vector3C)

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 static Complex operator |(Vector3C a, Vector3C b)

Parameters

a Vector3C

First Vector3C object.

b Vector3C

Second Vector3C object.

Returns

Complex

Scalar product of the two Vector3C objects.

operator /(Complex, Vector3C)

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).

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

Parameters

number Complex

The double value to divide by the components of the Vector3C object.

vector Vector3C

The Vector3C object used as divisor.

Returns

Vector3C

Returns the quotient of the double value and the Vector3C object.

operator /(Vector3C, Complex)

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

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

Parameters

vector Vector3C

The Vector3C object to divide by the Complex value.

divisor Complex

The Complex value used as divisor.

Returns

Vector3C

Returns the quotient of the Vector3C object and the Complex value.

operator /(Vector3C, Vector3C)

Performs a component-wise division of two Vector3C objects.

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

Parameters

a Vector3C

The first Vector3C object to divide by parameter b.

b Vector3C

The second Vector3C object used as divisor.

Returns

Vector3C

Returns the quotient of the two Vector3C objects.

operator ==(Vector3C, Vector3C)

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

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

Parameters

vector1 Vector3C

First Vector3C object to compare.

vector2 Vector3C

Second Vector3C object to compare.

Returns

bool

Returns true if the two objects are equal.

implicit operator Vector3C(Vector3D)

Converts a Vector3D object into a Vector3C object.

public static implicit operator Vector3C(Vector3D vector3D)

Parameters

vector3D Vector3D

Vector3D object to convert into a Vector3C object.

Returns

Vector3C

The converted Vector3C object.

operator !=(Vector3C, Vector3C)

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

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

Parameters

vector1 Vector3C

First Vector3C object to compare.

vector2 Vector3C

Second Vector3C object to compare.

Returns

bool

Returns true if the two objects are unequal.

operator *(Complex, Vector3C)

Multiplies a Vector3C object with a Complex value.

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

Parameters

factor Complex

The Complex value to multiply.

vector Vector3C

The Vector3C object to multiply.

Returns

Vector3C

Returns the product of the Vector3C object and the Complex value.

operator *(Vector3C, Complex)

Multiplies a Vector3C object with a Complex value.

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

Parameters

vector Vector3C

The Vector3C object to multiply.

factor Complex

The Complex value to multiply.

Returns

Vector3C

Returns the product of the Vector3C object and the Complex value.

operator *(Vector3C, Vector3C)

Multiplies two Vector3C objects.

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

Parameters

a Vector3C

The first Vector3C object to multiply.

b Vector3C

The second Vector3C object to multiply.

Returns

Vector3C

Returns the product of the two Vector3C objects.

operator -(Vector3C, Vector3C)

Subtracts two Vector3C objects.

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

Parameters

a Vector3C

The first Vector3C object to subtract from.

b Vector3C

The second Vector3C object to subtract.

Returns

Vector3C

Returns the difference of the two Vector3C objects.