# ToRotation2D

> Transform a 3D rotation into a 2D angle using the selected transform plane. If TransformPlane.Custom is used then PhysicsWorld.TransformPlane.XY is used.

## Definition

* **Type:** Method
* **Namespace:** [Unity.U2D.Physics](/engine/6000.5/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule

## ToRotation2D(Quaternion, TransformPlane)

Transform a 3D rotation into a 2D angle using the selected transform plane. If TransformPlane.Custom is used then [PhysicsWorld.TransformPlane.XY](/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplane/xy.md) is used.

```csharp
public static float ToRotation2D(Quaternion quaternion, PhysicsWorld.TransformPlane transformPlane = TransformPlane.XY)
```

### Parameters

**** (\[Quaternion]\(/engine/6000.5/script-reference/unityengine/quaternion)): The 3D rotation to transform.**** (\[TransformPlane]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplane)): The transform plane to use.

### Returns

| Type                                                          | Description                          |
| ------------------------------------------------------------- | ------------------------------------ |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The transformed rotation in radians. |

## ToRotation2D(Quaternion, TransformPlane, TransformPlaneCustom)

Transform a 3D rotation into a 2D angle using the selected transform plane.

```csharp
public static float ToRotation2D(Quaternion rotation, PhysicsWorld.TransformPlane transformPlane, in PhysicsWorld.TransformPlaneCustom transformPlaneCustom)
```

### Parameters

**** (\[Quaternion]\(/engine/6000.5/script-reference/unityengine/quaternion)): The 3D rotation to transform.**** (\[TransformPlane]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplane)): The transform plane to use.**** (\[TransformPlaneCustom]\(/engine/6000.5/script-reference/unity/u2d/physics/physicsworld/transformplanecustom)):&#x20;

### Returns

| Type                                                          | Description                          |
| ------------------------------------------------------------- | ------------------------------------ |
| [float](https://learn.microsoft.com/dotnet/api/system.single) | The transformed rotation in radians. |
