# project

> Compute vector projection of a onto b.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Mathematics](/engine/6000.5/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## project(float2, float2)

Compute vector projection of a onto b.

```csharp
public static float2 project(float2 a, float2 ontoB)
```

### Parameters

**** (\[float2]\(/engine/6000.5/script-reference/unity/mathematics/float2)): Vector to project.**** (\[float2]\(/engine/6000.5/script-reference/unity/mathematics/float2)): Non-zero vector to project onto.

### Returns

| Type                                                                  | Description                    |
| --------------------------------------------------------------------- | ------------------------------ |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Vector projection of a onto b. |

### Remarks

Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Single.MaxValue) or when b's components are very small (close to FLT\_MIN\_NORMAL). In these cases, you can call [\_projectsafe](/engine/6000.5/script-reference/unity/mathematics/math/projectsafe.md) which will use a given default value if the result is not finite.

## project(float3, float3)

Compute vector projection of a onto b.

```csharp
public static float3 project(float3 a, float3 ontoB)
```

### Parameters

**** (\[float3]\(/engine/6000.5/script-reference/unity/mathematics/float3)): Vector to project.**** (\[float3]\(/engine/6000.5/script-reference/unity/mathematics/float3)): Non-zero vector to project onto.

### Returns

| Type                                                                  | Description                    |
| --------------------------------------------------------------------- | ------------------------------ |
| [float3](/engine/6000.5/script-reference/unity/mathematics/float3.md) | Vector projection of a onto b. |

### Remarks

Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Single.MaxValue) or when b's components are very small (close to FLT\_MIN\_NORMAL). In these cases, you can call [\_projectsafe](/engine/6000.5/script-reference/unity/mathematics/math/projectsafe.md) which will use a given default value if the result is not finite.

## project(float4, float4)

Compute vector projection of a onto b.

```csharp
public static float4 project(float4 a, float4 ontoB)
```

### Parameters

**** (\[float4]\(/engine/6000.5/script-reference/unity/mathematics/float4)): Vector to project.**** (\[float4]\(/engine/6000.5/script-reference/unity/mathematics/float4)): Non-zero vector to project onto.

### Returns

| Type                                                                  | Description                    |
| --------------------------------------------------------------------- | ------------------------------ |
| [float4](/engine/6000.5/script-reference/unity/mathematics/float4.md) | Vector projection of a onto b. |

### Remarks

Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Single.MaxValue) or when b's components are very small (close to FLT\_MIN\_NORMAL). In these cases, you can call [\_projectsafe](/engine/6000.5/script-reference/unity/mathematics/math/projectsafe.md) which will use a given default value if the result is not finite.

## project(double2, double2)

Compute vector projection of a onto b.

```csharp
public static double2 project(double2 a, double2 ontoB)
```

### Parameters

**** (\[double2]\(/engine/6000.5/script-reference/unity/mathematics/double2)): Vector to project.**** (\[double2]\(/engine/6000.5/script-reference/unity/mathematics/double2)): Non-zero vector to project onto.

### Returns

| Type                                                                    | Description                    |
| ----------------------------------------------------------------------- | ------------------------------ |
| [double2](/engine/6000.5/script-reference/unity/mathematics/double2.md) | Vector projection of a onto b. |

### Remarks

Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Double.MaxValue) or when b's components are very small (close to DBL\_MIN\_NORMAL). In these cases, you can call [\_projectsafe](/engine/6000.5/script-reference/unity/mathematics/math/projectsafe.md) which will use a given default value if the result is not finite.

## project(double3, double3)

Compute vector projection of a onto b.

```csharp
public static double3 project(double3 a, double3 ontoB)
```

### Parameters

**** (\[double3]\(/engine/6000.5/script-reference/unity/mathematics/double3)): Vector to project.**** (\[double3]\(/engine/6000.5/script-reference/unity/mathematics/double3)): Non-zero vector to project onto.

### Returns

| Type                                                                    | Description                    |
| ----------------------------------------------------------------------- | ------------------------------ |
| [double3](/engine/6000.5/script-reference/unity/mathematics/double3.md) | Vector projection of a onto b. |

### Remarks

Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Double.MaxValue) or when b's components are very small (close to DBL\_MIN\_NORMAL). In these cases, you can call [\_projectsafe](/engine/6000.5/script-reference/unity/mathematics/math/projectsafe.md) which will use a given default value if the result is not finite.

## project(double4, double4)

Compute vector projection of a onto b.

```csharp
public static double4 project(double4 a, double4 ontoB)
```

### Parameters

**** (\[double4]\(/engine/6000.5/script-reference/unity/mathematics/double4)): Vector to project.**** (\[double4]\(/engine/6000.5/script-reference/unity/mathematics/double4)): Non-zero vector to project onto.

### Returns

| Type                                                                    | Description                    |
| ----------------------------------------------------------------------- | ------------------------------ |
| [double4](/engine/6000.5/script-reference/unity/mathematics/double4.md) | Vector projection of a onto b. |

### Remarks

Some finite vectors a and b could generate a non-finite result. This is most likely when a's components are very large (close to Double.MaxValue) or when b's components are very small (close to DBL\_MIN\_NORMAL). In these cases, you can call [\_projectsafe](/engine/6000.5/script-reference/unity/mathematics/math/projectsafe.md) which will use a given default value if the result is not finite.
