Skip to main content
Namespace: VM
Assembly: VM.dll

Constructors

Vector(Vector)

Initializes a new instance of the Vector class.

Parameters

vec Vector The Vector instance to copy.

Vector(double, double, double)

Initializes a new instance of the Vector class.

Parameters

dX double The X. dY double The Y. dZ double The Z.

Vector(double[])

Initializes a new instance of the Vector class.

Parameters

arVec double[] The arVec.

Vector(double[], int)

Initializes a new instance of the Vector class.

Parameters

arVec double[] The array that have values of vector. nStartIndex int The start index of array.

Vector(string)

Parameters

vector string

Properties

Magnitude

Gets the magnitude of vector.

Property Value

double

Exceptions

InvalidOperationException The get magnitude operation failed .

X

Gets or sets the X of vector.

Property Value

double

Y

Gets or sets the Y of vector.

Property Value

double

Z

Gets or sets the Z of vector.

Property Value

double

this[int]

Gets or sets the element of vector.

Property Value

double

this[Coordinate]

Gets or sets the element of vector.

Property Value

double

Methods

CopyToArray(Vector[], double[])

Copy all values in the array of vector to the array of double.

Parameters

arVec Vector[] The array of vector arTarget double[] The array to store values of the array of vector.

CopyToArray(Vector[], double[], int)

Copy all values in the array of vector to the array of double.

Parameters

arVec Vector[] The array of vector arTarget double[] The array to store values of the array of vector. nIndex int The start index of array

CrossProduct(Vector)

Cross product.

Parameters

vec Vector The vec.

Returns

Vector Result of product

DotProduct(Vector)

Dot product.

Parameters

vec Vector The vec.

Returns

double Result of product

Equals(object)

Determines whether the specified object is equal to the current object.

Parameters

obj object The object to compare.

Returns

bool true if the objects are equal, otherwise false.

GetArray()

Gets the array.

Returns

double[] The array.

GetDistance(Vector)

Gets the distance.

Parameters

vec Vector The vec.

Returns

double The distance

Exceptions

InvalidOperationException The get distance operation failed .

GetHashCode()

Returns the hash code for this vector

Returns

int A 32-bit signed integer hash code.

GetOrthoVector()

Gets the ortho vector.

Returns

Vector The ortho vector.

GetOrthoVector(Vector)

Gets the ortho vector.

Parameters

vecCandidate Vector The candidate.

Returns

Vector The ortho vector.

Exceptions

InvalidOperationException The get ortho vector operation failed .

Initialize()

Initialize the Vector

IsValidFormat(string)

Parameters

vector string

Returns

bool

MakeUnitVector()

Mate unit vector.

Exceptions

InvalidOperationException The make unit vector operation failed .

Set(Vector)

Sets the value of vector.

Parameters

vec Vector The Vector instance to copy.

Set(double[])

Sets the value of vector.

Parameters

arVec double[] The array of X, Y, Z Components.

Set(double[], int)

Sets the value of vector.

Parameters

arVec double[] The array of X, Y, Z Components. nStartIndex int The start index of array.

Set(double, double, double)

Sets the value of vector.

Parameters

dX double The X. dY double The Y. dZ double The Z.

ToString()

Returns a string that represents the current type.

Returns

string A string that represents the current object.

Operators

operator +(Vector, Vector)

Add two vectors.

Parameters

vecLeft Vector The left vector to add vecRight Vector The right vector to add

Returns

Vector The added vector.

operator /(Vector, double)

Divide value to the vector.

Parameters

vec Vector The vector to divide value dValue double The value to divide

Returns

Vector The divided vector.

operator ==(Vector, Vector)

Compare two vectors are same or not

Parameters

vecLeft Vector The left vector to compare vecRight Vector The right vector to compare

Returns

bool true if two vectors are same, otherwise false.

operator !=(Vector, Vector)

Compare two vectors are same or not

Parameters

vecLeft Vector The left vector to compare vecRight Vector The right vector to compare

Returns

bool true if two vectors are not same, otherwise false.

operator *(Vector, Vector)

Cross product two vectors.

Parameters

vecLeft Vector The left vector to cross product vecRight Vector The right vector to cross product

Returns

Vector The cross product vector.

operator *(Vector, double)

Multiply value to the vector.

Parameters

vec Vector The vector to multiply value dValue double The value to multiply

Returns

Vector The Multiplied vector.

operator -(Vector, Vector)

Subtract two vectors.

Parameters

vecLeft Vector The left vector to subtract vecRight Vector The right vector to subtract

Returns

Vector The subtracted vector.