> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Struct Vector

Namespace: [VM](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM)\
Assembly: VM.dll

```python theme={null}
public struct Vector
```

## Constructors

### Vector(Vector)

Initializes a new instance of the [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md) class.

```python theme={null}
public Vector(Vector vec)
```

#### Parameters

`vec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The Vector instance to copy.

### Vector(double, double, double)

Initializes a new instance of the [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md) class.

```python theme={null}
public Vector(double dX, double dY, double dZ)
```

#### Parameters

`dX` [double](https://learn.microsoft.com/dotnet/api/system.double)

The X.

`dY` [double](https://learn.microsoft.com/dotnet/api/system.double)

The Y.

`dZ` [double](https://learn.microsoft.com/dotnet/api/system.double)

The Z.

### Vector(double\[])

Initializes a new instance of the [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md) class.

```python theme={null}
public Vector(double[] arVec)
```

#### Parameters

`arVec` [double](https://learn.microsoft.com/dotnet/api/system.double)\[]

The arVec.

### Vector(double\[], int)

Initializes a new instance of the [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md) class.

```python theme={null}
public Vector(double[] arVec, int nStartIndex)
```

#### Parameters

`arVec` [double](https://learn.microsoft.com/dotnet/api/system.double)\[]

The array that have values of vector.

`nStartIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The start index of array.

### Vector(string)

```python theme={null}
public Vector(string vector)
```

#### Parameters

`vector` [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### Magnitude

Gets the magnitude of vector.

```python theme={null}
public double Magnitude { get; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

#### Exceptions

[InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception)

The get magnitude operation failed .

### X

Gets or sets the X of vector.

```python theme={null}
public double X { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

### Y

Gets or sets the Y of vector.

```python theme={null}
public double Y { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

### Z

Gets or sets the Z of vector.

```python theme={null}
public double Z { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

### this\[int]

Gets or sets the element of vector.

```python theme={null}
public double this[int nIndex] { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

### this\[Coordinate]

Gets or sets the element of vector.

```python theme={null}
public double this[Coordinate enCoord] { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

## Methods

### CopyToArray(Vector\[], double\[])

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

```python theme={null}
public static void CopyToArray(Vector[] arVec, double[] arTarget)
```

#### Parameters

`arVec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)\[]

The array of vector

`arTarget` [double](https://learn.microsoft.com/dotnet/api/system.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.

```python theme={null}
public static void CopyToArray(Vector[] arVec, double[] arTarget, int nIndex)
```

#### Parameters

`arVec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)\[]

The array of vector

`arTarget` [double](https://learn.microsoft.com/dotnet/api/system.double)\[]

The array to store values of the array of vector.

`nIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The start index of array

### CrossProduct(Vector)

Cross product.

```python theme={null}
public Vector CrossProduct(Vector vec)
```

#### Parameters

`vec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The vec.

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

Result of product

### DotProduct(Vector)

Dot product.

```python theme={null}
public double DotProduct(Vector vec)
```

#### Parameters

`vec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The vec.

#### Returns

[double](https://learn.microsoft.com/dotnet/api/system.double)

Result of product

### Equals(object)

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

```python theme={null}
public override bool Equals(object obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)

The object to compare.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if the objects are equal, otherwise false.

### GetArray()

Gets the array.

```python theme={null}
public double[] GetArray()
```

#### Returns

[double](https://learn.microsoft.com/dotnet/api/system.double)\[]

The array.

### GetDistance(Vector)

Gets the distance.

```python theme={null}
public double GetDistance(Vector vec)
```

#### Parameters

`vec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The vec.

#### Returns

[double](https://learn.microsoft.com/dotnet/api/system.double)

The distance

#### Exceptions

[InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception)

The get distance operation failed .

### GetHashCode()

Returns the hash code for this vector

```python theme={null}
public override int GetHashCode()
```

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)

A 32-bit signed integer hash code.

### GetOrthoVector()

Gets the ortho vector.

```python theme={null}
public Vector GetOrthoVector()
```

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The ortho vector.

### GetOrthoVector(Vector)

Gets the ortho vector.

```python theme={null}
public Vector GetOrthoVector(Vector vecCandidate)
```

#### Parameters

`vecCandidate` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The candidate.

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The ortho vector.

#### Exceptions

[InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception)

The get ortho vector operation failed .

### Initialize()

Initialize the Vector

```python theme={null}
public void Initialize()
```

### IsValidFormat(string)

```python theme={null}
public static bool IsValidFormat(string vector)
```

#### Parameters

`vector` [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### MakeUnitVector()

Mate unit vector.

```python theme={null}
public void MakeUnitVector()
```

#### Exceptions

[InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception)

The make unit vector operation failed .

### Set(Vector)

Sets the value of vector.

```python theme={null}
public void Set(Vector vec)
```

#### Parameters

`vec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The Vector instance to copy.

### Set(double\[])

Sets the value of vector.

```python theme={null}
public void Set(double[] arVec)
```

#### Parameters

`arVec` [double](https://learn.microsoft.com/dotnet/api/system.double)\[]

The array of X, Y, Z Components.

### Set(double\[], int)

Sets the value of vector.

```python theme={null}
public void Set(double[] arVec, int nStartIndex)
```

#### Parameters

`arVec` [double](https://learn.microsoft.com/dotnet/api/system.double)\[]

The array of X, Y, Z Components.

`nStartIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The start index of array.

### Set(double, double, double)

Sets the value of vector.

```python theme={null}
public void Set(double dX, double dY, double dZ)
```

#### Parameters

`dX` [double](https://learn.microsoft.com/dotnet/api/system.double)

The X.

`dY` [double](https://learn.microsoft.com/dotnet/api/system.double)

The Y.

`dZ` [double](https://learn.microsoft.com/dotnet/api/system.double)

The Z.

### ToString()

Returns a string that represents the current type.

```python theme={null}
public override string ToString()
```

#### Returns

[string](https://learn.microsoft.com/dotnet/api/system.string)

A string that represents the current object.

## Operators

### operator +(Vector, Vector)

Add two vectors.

```python theme={null}
public static Vector operator +(Vector vecLeft, Vector vecRight)
```

#### Parameters

`vecLeft` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The left vector to add

`vecRight` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The right vector to add

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The added vector.

### operator /(Vector, double)

Divide value to the vector.

```python theme={null}
public static Vector operator /(Vector vec, double dValue)
```

#### Parameters

`vec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The vector to divide value

`dValue` [double](https://learn.microsoft.com/dotnet/api/system.double)

The value to divide

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The divided vector.

### operator ==(Vector, Vector)

Compare two vectors are same or not

```python theme={null}
public static bool operator ==(Vector vecLeft, Vector vecRight)
```

#### Parameters

`vecLeft` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The left vector to compare

`vecRight` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The right vector to compare

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if two vectors are same, otherwise false.

### operator !=(Vector, Vector)

Compare two vectors are same or not

```python theme={null}
public static bool operator !=(Vector vecLeft, Vector vecRight)
```

#### Parameters

`vecLeft` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The left vector to compare

`vecRight` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The right vector to compare

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

true if two vectors are not same, otherwise false.

### operator \*(Vector, Vector)

Cross product two vectors.

```python theme={null}
public static Vector operator *(Vector vecLeft, Vector vecRight)
```

#### Parameters

`vecLeft` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The left vector to cross product

`vecRight` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The right vector to cross product

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The cross product vector.

### operator \*(Vector, double)

Multiply value to the vector.

```python theme={null}
public static Vector operator *(Vector vec, double dValue)
```

#### Parameters

`vec` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The vector to multiply value

`dValue` [double](https://learn.microsoft.com/dotnet/api/system.double)

The value to multiply

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The Multiplied vector.

### operator -(Vector, Vector)

Subtract two vectors.

```python theme={null}
public static Vector operator -(Vector vecLeft, Vector vecRight)
```

#### Parameters

`vecLeft` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The left vector to subtract

`vecRight` [Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The right vector to subtract

#### Returns

[Vector](https://developer.synopsys.com/docs/motion/motion-standalone-postprocessor-c-sharp-library/2025-r2/lib/VM.Vector.md)

The subtracted vector.
