# Plane

> Representation of a plane in 3D space.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IFormattable](https://learn.microsoft.com/dotnet/api/system.iformattable)

```csharp
public struct Plane : IFormattable
```

## Remarks

A plane is an infinitely large, flat surface that exists in 3D space and divides the space into two halves known as *half-spaces*. It is easy to determine which of the two half-spaces a particular point is in and also how far the point is from the plane. Walls, floors and other flat surfaces are common in games, so a plane is sometimes useful for mathematical calculations with these objects. Also, there are cases where a real surface does not exist but it is useful to imagine that one is there. For example, in sports, a goal line or out-of-bounds line is often assumed to extend into the air, effectively defining a plane.

When a plane passes through the \<0,0,0> point in world space, it is defined simply by a normal vector that determines which way it faces. It is easy to visualise this if you imagine looking at the plane edge-on.

![PlaneNormalOrigin (Plane)](/api/media?file=/engine/6000.0/media/images/PlaneNormalOrigin.png)

Note that the side from which the normal vector points is important since it is used to identify which half-space a point is in (ie, on the positive or "normal" side of the plane or the other side). When the plane doesn't pass through \<0,0,0> it can be defined by the normal vector along with a distance from \<0,0,0>

![PlaneNormalOffset (Plane)](/api/media?file=/engine/6000.0/media/images/PlaneNormalOffset.png)

A plane can also be defined by the three corner points of a triangle that lies within the plane. In this case, the normal vector points toward you if the corner points go around clockwise as you look at the triangle face-on.

![Plane3Points (Plane)](/api/media?file=/engine/6000.0/media/images/Plane3Points.png).

## Constructors

| Constructor                                                                                                                                                      | Description      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| [Plane(UnityEngine.Vector3,System.Single)](/engine/6000.0/script-reference/unityengine/plane/ctor.md#plane\(vector3-float\))                                     | Creates a plane. |
| [Plane(UnityEngine.Vector3,UnityEngine.Vector3)](/engine/6000.0/script-reference/unityengine/plane/ctor.md#plane\(vector3-vector3\))                             | Creates a plane. |
| [Plane(UnityEngine.Vector3,UnityEngine.Vector3,UnityEngine.Vector3)](/engine/6000.0/script-reference/unityengine/plane/ctor.md#plane\(vector3-vector3-vector3\)) | Creates a plane. |

## Properties

| Property                                                                  | Description                                                                   |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [distance](/engine/6000.0/script-reference/unityengine/plane/distance.md) | The distance measured from the Plane to the origin, along the Plane's normal. |
| [flipped](/engine/6000.0/script-reference/unityengine/plane/flipped.md)   | Returns a copy of the plane that faces in the opposite direction.             |
| [normal](/engine/6000.0/script-reference/unityengine/plane/normal.md)     | Normal vector of the plane.                                                   |

## Methods

| Method                                                                                            | Description                                                                                                                           |
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| [ClosestPointOnPlane](/engine/6000.0/script-reference/unityengine/plane/closestpointonplane.md)   | For a given point returns the closest point on the plane.                                                                             |
| [Flip](/engine/6000.0/script-reference/unityengine/plane/flip.md)                                 | Makes the plane face in the opposite direction.                                                                                       |
| [GetDistanceToPoint](/engine/6000.0/script-reference/unityengine/plane/getdistancetopoint.md)     | Returns a signed distance from plane to point.                                                                                        |
| [GetSide](/engine/6000.0/script-reference/unityengine/plane/getside.md)                           | Is a point on the positive side of the plane?                                                                                         |
| [Raycast](/engine/6000.0/script-reference/unityengine/plane/raycast.md)                           | Intersects a ray with the plane.                                                                                                      |
| [SameSide](/engine/6000.0/script-reference/unityengine/plane/sameside.md)                         | Are two points on the same side of the plane?                                                                                         |
| [Set3Points](/engine/6000.0/script-reference/unityengine/plane/set3points.md)                     | Sets a plane using three points that lie within it.  The points go around clockwise as you look down on the top surface of the plane. |
| [SetNormalAndPosition](/engine/6000.0/script-reference/unityengine/plane/setnormalandposition.md) | Sets a plane using a point that lies within it along with a normal to orient it.                                                      |
| [Translate](/engine/6000.0/script-reference/unityengine/plane/translate.md)                       | Moves the plane in space by the translation vector.                                                                                   |

## Static Methods

| Method                                                                      | Description                                                                        |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [Translate](/engine/6000.0/script-reference/unityengine/plane/translate.md) | Returns a copy of the given plane that is moved in space by the given translation. |
