---
title: projectonplane
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/mathematics/math/projectonplane
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/mathematics/math/projectonplane.md
last_updated: 2026-11-20
generated_at: 2026-11-25T22:12:29.146Z
locale: en-us
---

# projectonplane

> Returns the projection of a onto the line through the origin that is perpendicular to planeNormal.

## Definition

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

## projectonplane(float2, float2)

Returns the projection of a onto the line through the origin that is perpendicular to planeNormal.

```csharp
public static float2 projectonplane(float2 a, float2 planeNormal)
```

### Parameters

**** (\[float2]\(/engine/7000.0/script-reference/unity/mathematics/float2)): Vector to project.**** (\[float2]\(/engine/7000.0/script-reference/unity/mathematics/float2)): Non-zero normal of the line to project onto.

### Returns

| Type                                                                  | Description                                                     |
| --------------------------------------------------------------------- | --------------------------------------------------------------- |
| [float2](/engine/7000.0/script-reference/unity/mathematics/float2.md) | The projection of a onto the line perpendicular to planeNormal. |

### Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call [math.projectonplanesafe](/engine/7000.0/script-reference/unity/mathematics/math/projectonplanesafe.md) which will use a given default value if the result is not finite.

## projectonplane(float3, float3)

Returns the projection of a onto the plane through the origin with normal planeNormal.

```csharp
public static float3 projectonplane(float3 a, float3 planeNormal)
```

### Parameters

**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): Vector to project.**** (\[float3]\(/engine/7000.0/script-reference/unity/mathematics/float3)): Non-zero normal of the plane to project onto.

### Returns

| Type                                                                  | Description                         |
| --------------------------------------------------------------------- | ----------------------------------- |
| [float3](/engine/7000.0/script-reference/unity/mathematics/float3.md) | The projection of a onto the plane. |

### Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call [math.projectonplanesafe](/engine/7000.0/script-reference/unity/mathematics/math/projectonplanesafe.md) which will use a given default value if the result is not finite.

## projectonplane(float4, float4)

Returns the projection of a onto the hyperplane through the origin with normal planeNormal.

```csharp
public static float4 projectonplane(float4 a, float4 planeNormal)
```

### Parameters

**** (\[float4]\(/engine/7000.0/script-reference/unity/mathematics/float4)): Vector to project.**** (\[float4]\(/engine/7000.0/script-reference/unity/mathematics/float4)): Non-zero normal of the hyperplane to project onto.

### Returns

| Type                                                                  | Description                              |
| --------------------------------------------------------------------- | ---------------------------------------- |
| [float4](/engine/7000.0/script-reference/unity/mathematics/float4.md) | The projection of a onto the hyperplane. |

### Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call [math.projectonplanesafe](/engine/7000.0/script-reference/unity/mathematics/math/projectonplanesafe.md) which will use a given default value if the result is not finite.

## projectonplane(double2, double2)

Returns the projection of a onto the line through the origin that is perpendicular to planeNormal.

```csharp
public static double2 projectonplane(double2 a, double2 planeNormal)
```

### Parameters

**** (\[double2]\(/engine/7000.0/script-reference/unity/mathematics/double2)): Vector to project.**** (\[double2]\(/engine/7000.0/script-reference/unity/mathematics/double2)): Non-zero normal of the line to project onto.

### Returns

| Type                                                                    | Description                                                     |
| ----------------------------------------------------------------------- | --------------------------------------------------------------- |
| [double2](/engine/7000.0/script-reference/unity/mathematics/double2.md) | The projection of a onto the line perpendicular to planeNormal. |

### Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call [math.projectonplanesafe](/engine/7000.0/script-reference/unity/mathematics/math/projectonplanesafe.md) which will use a given default value if the result is not finite.

## projectonplane(double3, double3)

Returns the projection of a onto the plane through the origin with normal planeNormal.

```csharp
public static double3 projectonplane(double3 a, double3 planeNormal)
```

### Parameters

**** (\[double3]\(/engine/7000.0/script-reference/unity/mathematics/double3)): Vector to project.**** (\[double3]\(/engine/7000.0/script-reference/unity/mathematics/double3)): Non-zero normal of the plane to project onto.

### Returns

| Type                                                                    | Description                         |
| ----------------------------------------------------------------------- | ----------------------------------- |
| [double3](/engine/7000.0/script-reference/unity/mathematics/double3.md) | The projection of a onto the plane. |

### Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call [math.projectonplanesafe](/engine/7000.0/script-reference/unity/mathematics/math/projectonplanesafe.md) which will use a given default value if the result is not finite.

## projectonplane(double4, double4)

Returns the projection of a onto the hyperplane through the origin with normal planeNormal.

```csharp
public static double4 projectonplane(double4 a, double4 planeNormal)
```

### Parameters

**** (\[double4]\(/engine/7000.0/script-reference/unity/mathematics/double4)): Vector to project.**** (\[double4]\(/engine/7000.0/script-reference/unity/mathematics/double4)): Non-zero normal of the hyperplane to project onto.

### Returns

| Type                                                                    | Description                              |
| ----------------------------------------------------------------------- | ---------------------------------------- |
| [double4](/engine/7000.0/script-reference/unity/mathematics/double4.md) | The projection of a onto the hyperplane. |

### Remarks

planeNormal doesn't need to be unit length but must not be zero. Some finite inputs could generate a non-finite result, most likely when a's components are very large or planeNormal's components are very small. In these cases, you can call [math.projectonplanesafe](/engine/7000.0/script-reference/unity/mathematics/math/projectonplanesafe.md) which will use a given default value if the result is not finite.
