# PhysicsRotate

> Represents a 2D rotation.

## Definition

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

```csharp
public struct PhysicsRotate : ISerializationCallbackReceiver
```

## Fields

| Value                                                                                     | Description                                                                                                                                                                                                                                                                                                                                                                                              |
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [direction](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/direction.md) | The rotation direction where X = cos(rotation) and Y = sin(rotation). This should always be normalized otherwise warnings will be produced when used, however this is not enforced. See [\_isNormalized](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/isnormalized.md) and [PhysicsRotate.Normalized](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/normalized.md). |

## Constructors

| Constructor                                                                                                                                                                                               | Description                                                                                                   |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [PhysicsRotate()](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/ctor.md#physicsrotate\(\))                                                                                              | Create an identity rotation.                                                                                  |
| [PhysicsRotate(UnityEngine.Quaternion,Unity.U2D.Physics.PhysicsWorld.TransformPlane)](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/ctor.md#physicsrotate\(quaternion-transformplane\)) | Create a rotation with the specified [Quaternion](/engine/6000.5/script-reference/unityengine/quaternion.md). |
| [PhysicsRotate(UnityEngine.Vector2)](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/ctor.md#physicsrotate\(vector2\))                                                                    | Create a rotation with the specified direction.                                                               |

## Properties

| Property                                                                                        | Description                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [cos](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/cos.md)                   | The cosine of the rotation angle.                                                                                                                                            |
| [degrees](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/degrees.md)           | Get the rotation, in degrees.                                                                                                                                                |
| [isNormalized](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/isnormalized.md) | Is the rotation normalized? If not, it should be normalized using [PhysicsRotate.Normalized](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/normalized.md). |
| [isValid](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/isvalid.md)           | Check if the rotation is valid (not NaN and Normalized).                                                                                                                     |
| [radians](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/radians.md)           | Get the rotation, in radians.                                                                                                                                                |
| [sin](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/sin.md)                   | The sine of the rotation angle.                                                                                                                                              |

## Static Properties

| Property                                                                                | Description                                                                                                                                              |
| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [down](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/down.md)         | A rotation of -PI/2 Radians (-90 Degrees or +270 Degrees).                                                                                               |
| [identity](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/identity.md) | The identity rotation i.e. no rotation.                                                                                                                  |
| [left](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/left.md)         | A rotation of +PI Radians (+/- 180 Degrees).                                                                                                             |
| [right](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/right.md)       | A rotation of zero Radians. This is the same as identity. See [\_identity](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/identity.md). |
| [up](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/up.md)             | A rotation of +PI/2 Radians (+90 Degrees).                                                                                                               |

## Methods

| Method                                                                                                                | Description                                                                                                                                                                                |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [AngularVelocity](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/angularvelocity.md)                 | Calculate the angular velocity necessary to rotate the current rotation and the specified rotation over a give time.                                                                       |
| [GetMatrix](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/getmatrix.md)                             | Calculate a rotation [Matrix4x4](/engine/6000.5/script-reference/unityengine/matrix4x4.md) using the specified transform plane.                                                            |
| [GetRelativeAngle](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/getrelativeangle.md)               | Get the relative angle between this rotation and the specified rotation. The limits of this are +/- [PhysicsMath.PI](/engine/6000.5/script-reference/unity/u2d/physics/physicsmath/pi.md). |
| [IntegrateRotation](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/integraterotation.md)             | Integrate the rotation using the specified angle change.                                                                                                                                   |
| [Inverse](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/inverse.md)                                 | Calculate a new inverse rotation of the current rotation.                                                                                                                                  |
| [InverseMultiplyRotation](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/inversemultiplyrotation.md) | Inverse Multiply a rotation with this rotation.                                                                                                                                            |
| [InverseRotateVector](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/inverserotatevector.md)         | Inverse Rotate a vector.                                                                                                                                                                   |
| [LerpRotation](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/lerprotation.md)                       | Calculate the normalized linear interpolation of this rotation and the specified rotation using the specified interval.                                                                    |
| [MultiplyRotation](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/multiplyrotation.md)               | Multiply a rotation with this rotation.                                                                                                                                                    |
| [Normalized](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/normalized.md)                           | Create a normalized rotation.                                                                                                                                                              |
| [Rotate](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/rotate.md)                                   | Calculate a new rotation of the current rotation by the specified angle.                                                                                                                   |
| [RotateVector](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/rotatevector.md)                       | Rotate a vector.                                                                                                                                                                           |

## Static Methods

| Method                                                                                                | Description                                                                                       |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| [AngularVelocity](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/angularvelocity.md) | Calculate the angular velocity necessary to rotate between two rotations over a give time.        |
| [FromDegrees](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/fromdegrees.md)         | Create a rotation with the specified rotation, in degrees.                                        |
| [FromRadians](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/fromradians.md)         | Create a rotation with the specified rotation, in radians.                                        |
| [LerpRotation](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/lerprotation.md)       | Calculate the normalized linear interpolation between two rotations using the specified fraction. |
| [UnwindAngle](/engine/6000.5/script-reference/unity/u2d/physics/physicsrotate/unwindangle.md)         | Convert any angle into the range \[-pi, pi].                                                      |
