# Vector

### Vector Struct

The Vector class represents a 3 dimensional vector.

### Syntax

public struct **Vector**

### Member Details

#### Vector Constructor

> Creates a new vector with the supplied values.
>
> #### Syntax
>
> public **Vector** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Mono.Simd.Vector4f](http://docs.go-mono.com/?link=T%3aMono.Simd.Vector4f) v)
>
> **Parameters**
>
> > *v*
> >
> > Initializes the vector from a [Mono.Simd.Vector4f](http://docs.go-mono.com/?link=T%3aMono.Simd.Vector4f). W should be 0 and is assumed to be 0 for most operations.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Vector Constructor

> Creates a new vector with all values set to the given value.
>
> #### Syntax
>
> public **Vector** ([float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) all)
>
> **Parameters**
>
> > *all*
> >
> > The value for all coordinates.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Vector Constructor

> Creates a new vector with the supplied values.
>
> #### Syntax
>
> **Parameters**
>
> > *x*
> >
> > The x coordinate.
> >
> > *y*
> >
> > The y coordinate.
> >
> > *z*
> >
> > The z coordinate.
> >
> > *w*
> >
> > The w coordinate. W defaults to 0 and is assumed to be 0 for most operations.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### AngleTo Method

> Returns the angle in radians between this vector and the given vector.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **AngleTo** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *b*
> >
> > The angle to compare.
>
> **Returns**
>
> > The smallest angle in radians between the two vectors.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Back Field

> Deprecated back vector.
>
> #### Syntax
>
> \[System.Obsolete("Use ObjectBack for correct back vector.", false)]\
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Back**
>
> **See Also**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Cross Method

> Calculates the cross product of 2 3D vectors.
>
> #### Syntax
>
> public [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Cross** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *b*
> >
> > The second vector.
>
> **Returns**
>
> > a X b
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Dot Method

> Performs a 3-component scalar or dot product.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **Dot** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *b*
> >
> > The second vector.
>
> **Returns**
>
> > Returns X\*b.X+Y\*b.Y+Z\*b.Z
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Dot3 Method

> Performs a 3-component scalar or dot product.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **Dot3** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *b*
> >
> > The second vector.
>
> **Returns**
>
> > Returns X\*b.X+Y\*b.Y+Z\*b.Z
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Dot4 Method

> Performs a 4-component scalar or dot product.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **Dot4** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *b*
> >
> > The second vector.
>
> **Returns**
>
> > Returns X\*b.X+Y\*b.Y+Z\*b.Z+W\*b.W
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Down Field

> Deprecated down vector.
>
> #### Syntax
>
> \[System.Obsolete("Use ObjectDown for correct down vector.", false)]\
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Down**
>
> **See Also**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Forward Field

> Deprecated forward vector.
>
> #### Syntax
>
> \[System.Obsolete("Use ObjectForward for correct forward vector.", false)]\
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Forward**
>
> **See Also**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Item Property

> Allows getting coordinates by index.
>
> #### Syntax
>
> *This is the default property for this class.*
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) this \[[int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) index] { get; set; }
>
> **Parameters**
>
> > *index*
> >
> > 0=>X, 1=>Y, 2=>Z, 3=>W
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Left Field

> Deprecated left vector.
>
> #### Syntax
>
> \[System.Obsolete("Use ObjectLeft for correct left vector.", false)]\
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Left**
>
> **See Also**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Length Method

> Calculates the magnitude of this vector.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **Length** ()
>
> **Returns**
>
> > The 3D vector length.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### LengthSquared Method

> Calculates the square magnitude of this vector.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **LengthSquared** ()
>
> **Returns**
>
> > The square of the 3D vector length.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Lerp Method

> Performs a linear interpolation between two vectors.
>
> #### Syntax
>
> public [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Lerp** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b, [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) amount)
>
> **Parameters**
>
> > *b*
> >
> > The second vector.
> >
> > *amount*
> >
> > Value from \[0..1] indicating the weight for the second vector.
>
> **Returns**
>
> > A vector that is linearly interpolated between the two sources.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Normalized Method

> Returns a vector with the same orientation and unit length.
>
> #### Syntax
>
> public [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Normalized** ()
>
> **Returns**
>
> > A vector with the same orientation and unit length.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ObjectBack Field

> The default world back vector.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **ObjectBack**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ObjectDown Field

> The default world down vector.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **ObjectDown**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ObjectForward Field

> The default world forward vector.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **ObjectForward**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ObjectLeft Field

> The default world left vector.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **ObjectLeft**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ObjectRight Field

> The default world right vector.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **ObjectRight**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ObjectUp Field

> The default world up vector.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **ObjectUp**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### One Field

> A vector with all components 1.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **One**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### op\_Addition Method

> Performs vector addition.
>
> #### Syntax
>
> public static [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) operator+ (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) a, \[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *a*
> >
> > The first Vector.
> >
> > *b*
> >
> > The second Vector.
>
> **Returns**
>
> > A new vector that is the sum of the arguments.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### op\_Division Method

> Divides vector components by a scalar.
>
> #### Syntax
>
> public static [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) operator/ (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) a, [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) b)
>
> **Parameters**
>
> > *a*
> >
> > The vector.
> >
> > *b*
> >
> > The scalar.
>
> **Returns**
>
> > Returns a new vector with value \[a.X/b, a.Y/b, a.Z/b, a.W/b]
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Conversion Method

> Converts a Mono.Simd.Vector4f to a vector.
>
> #### Syntax
>
> public static implicit operator [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Mono.Simd.Vector4f](http://docs.go-mono.com/?link=T%3aMono.Simd.Vector4f) v)
>
> **Parameters**
>
> > *v*
> >
> > The vector to convert
>
> **Returns**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Conversion Method

> Converts a vector to a Mono.Simd.Vector4f
>
> #### Syntax
>
> public static implicit operator [Mono.Simd.Vector4f](http://docs.go-mono.com/?link=T%3aMono.Simd.Vector4f) (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) v)
>
> **Parameters**
>
> > *v*
> >
> > The vector to convert
>
> **Returns**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### op\_Multiply Method

> Performs a vector scalar multiplication.
>
> #### Syntax
>
> public static [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) operator\* (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) a, [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) b)
>
> **Parameters**
>
> > *a*
> >
> > The vector.
> >
> > *b*
> >
> > The scalar.
>
> **Returns**
>
> > Returns a new vector with value \[a.X\*b, a.Y\*b, a.Z\*b, a.W\*b]
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### op\_Multiply Method

> Performs a vector scalar multiplication.
>
> #### Syntax
>
> public static [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) operator\* ([float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) a, \[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *a*
> >
> > The scalar.
> >
> > *b*
> >
> > The vector.
>
> **Returns**
>
> > Returns a new vector with value \[a\*b.X, a\*b.Y, a\*b.Z, a\*b.W]
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### op\_Subtraction Method

> Performs vector subtraction.
>
> #### Syntax
>
> public static [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) operator- (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) a, \[System.Runtime.CompilerServices.IsReadOnly] *ref* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) b)
>
> **Parameters**
>
> > *a*
> >
> > The first Vector.
> >
> > *b*
> >
> > The second Vector.
>
> **Returns**
>
> > A new vector that is the difference of the arguments.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Orthonormalize Method

> Normalizes the two vectors and returns the normalized cross product.
>
> #### Syntax
>
> **Parameters**
>
> > *forward*
> >
> > The facing ve
> >
> > *up*
>
> **Returns**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Parse Method

> Parse a Vector from a string.
>
> #### Syntax
>
> **Parameters**
>
> > *vectorString*
> >
> > A string of the format \<X,Y,Z> or \<X,Y,Z,W>
>
> **Returns**
>
> > The Vector parsed from the string.
>
> **Exceptions**

| Type                                                                                          | Reason                                                                      |
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| [ArgumentException](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.ArgumentException) | If vectorString is null.                                                    |
| [FormatException](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.FormatException)     | If the string is not a valid vector or its components are not valid floats. |

> #### Remarks
>
> #### Example

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><strong>C# Example</strong></td></tr><tr><td><pre><code>Vector myVector = Vector.Parse("&#x3C;1,2.34,5.6>");
</code></pre></td></tr><tr><td></td></tr></tbody></table>

> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Right Field

> Deprecated right vector.
>
> #### Syntax
>
> \[System.Obsolete("Use ObjectRight for correct right vector.", false)]\
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Right**
>
> **See Also**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Rotate Method

> Returns a new vector which is this vector rotated by the given quaternion.
>
> #### Syntax
>
> public [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Rotate** (\[System.Runtime.CompilerServices.IsReadOnly] *ref* [Quaternion](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/quarterion) q)
>
> **Parameters**
>
> > *q*
> >
> > The quaternion rotation.
>
> **Returns**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ToString Method

> Generates a string representation of the vector.
>
> #### Syntax
>
> public override [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **ToString** ()
>
> **Returns**
>
> > The vector as a string.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ToString Method

> Generates a string representation of the vector.
>
> #### Syntax
>
> **Parameters**
>
> > *format*
> >
> > Format to use for each of the coordinates.
>
> **Returns**
>
> > The vector as a string.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### ToString4 Method

> Generates a string representation of the vector, including the W parameter.
>
> #### Syntax
>
> **Parameters**
>
> > *format*
> >
> > Format to use for each of the coordinates.
>
> **Returns**
>
> > The vector as a string.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### TryParse Method

> Attempt to parse a Vector from a string
>
> #### Syntax
>
> public static [bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) **TryParse** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) vectorString, *out* [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) vector)
>
> **Parameters**
>
> > *vectorString*
> >
> > A string of the format \<X,Y,Z> or \<X,Y,Z,W>
> >
> > *vector*
> >
> > The vector that will be set if vectorString represents a valid vector.
>
> **Returns**
>
> > True if successfully parsed a vector, false if not.
>
> #### Remarks
>
> #### Example

<table data-header-hidden><thead><tr><th></th></tr></thead><tbody><tr><td><strong>C# Example</strong></td></tr><tr><td><pre><code>Vector myVector;
</code></pre></td></tr></tbody></table>

```
        if (Vector.Parse("&#x3C;1,2.34,5.6>", out myVector)
        {
            // myVector is set
        }
```

|

> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Up Field

> Deprecated up Vector
>
> #### Syntax
>
> \[System.Obsolete("Use ObjectUp for correct up vector.", false)]\
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Up**
>
> **See Also**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### W Property

> The W coordinate of the vector.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **W** { get; set; }
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### X Property

> The X coordinate of the vector.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **X** { get; set; }
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Y Property

> The Y coordinate of the vector.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **Y** { get; set; }
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Z Property

> The Z coordinate of the vector.
>
> #### Syntax
>
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **Z** { get; set; }
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Zero Field

> A vector with all components 0.
>
> #### Syntax
>
> public static readonly [Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **Zero**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

***
