# ToAngleAxis(out float, out Vector3)

> Converts a rotation to angle-axis representation.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## ToAngleAxis(float, Vector3)

```csharp
public void ToAngleAxis(out float angle, out Vector3 axis)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The rotation angle in degrees. The value is in the range \[0, 360].**** (\[Vector3]\(/engine/6000.6/script-reference/unityengine/vector3)): The axis of rotation as a normalized `Vector3`. If the quaternion represents no rotation, the axis defaults to `Vector3.right`.

### Remarks

This method decomposes the quaternion into an angle (in degrees) and a unit vector representing the axis of rotation. Normalize the quaternion before calling this method, otherwise Unity throws an exception.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // Extracts the angle - axis from euler angle rotation
        Quaternion rotation = Quaternion.Euler(0, 90, 0);
        rotation.ToAngleAxis(out float angle, out Vector3 axis);
        // angle is 90
        // axis is (0, 1, 0)

        // Extracts the angle - axis rotation from the transform rotation
        float transformRotationAngle = 0.0f;
        Vector3 transformRotationAxis = Vector3.zero;
        transform.rotation.ToAngleAxis(out transformRotationAngle, out transformRotationAxis);
    }
}
```
