# Vector Extensions

### VectorExtensions Class

Additional methods for Mono.Simd.Vector4f.

### Syntax

public static class **VectorExtensions**

### Member Details

#### Cos Method

> Returns the approximate cosine of the four floats in the vector.
>
> #### Syntax
>
> **Parameters**
>
> > *x*
> >
> > A vector of 4 floats.
>
> **Returns**
>
> > The approximate cosine of each element.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### CosSlow Method

> Returns the cosine each element of the vector.
>
> #### Syntax
>
> **Parameters**
>
> > *v1*
> >
> > A vector of 4 floats.
>
> **Returns**
>
> > The cosine of each element.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### SelectWithMask Method

> Creates a new vector4f from the given vectors, selecting a component from sourceIfTrue if the corresponding component in the mask is -1 and from sourceIfFalse if 0.
>
> #### Syntax
>
> **Parameters**
>
> > *mask*
> >
> > The mask vector.
> >
> > *sourceIfTrue*
> >
> > The vector containing the elements that are selected if the mask is true.
> >
> > *sourceIfFalse*
> >
> > The vector containing the elements that are selected if the maks is false.
>
> **Returns**
>
> > A new vector with elements selected from the source vectors based on the mask.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### Sin Method

> Returns the approximate sine of the four floats in the vector.
>
> #### Syntax
>
> **Parameters**
>
> > *a*
> >
> > A vector of 4 floats
>
> **Returns**
>
> > A fast approximation of the sine of each of the 4 floats.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### SinSlow Method

> Returns the sine each element of the vector.
>
> #### Syntax
>
> **Parameters**
>
> > *v1*
> >
> > A vector of 4 floats.
>
> **Returns**
>
> > The sine of each element.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

#### SinZeroPiOverTwo Method

> Returns the approximate sine of each element in the vector.
>
> #### Syntax
>
> **Parameters**
>
> > *x*
> >
> > A vector of 4 floats.
>
> **Returns**
>
> > The approximate sine of each element.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar\
> **Assembly:** Sansar.Script (in Sansar.Script.dll)\
> **Assembly Versions:** 1.0.0.0
>
> ***

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector-extensions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
