---
title: axis(quaternion)
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/axis
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/mathematics/math/axis.md
last_updated: 2026-11-20
generated_at: 2026-11-25T22:12:22.034Z
locale: en-us
---

# axis(quaternion)

> Returns the axis that a unit quaternion rotates around.

## Definition

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

```csharp
public static float3 axis(quaternion q)
```

### Parameters

**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The unit quaternion.

### Returns

| Type                                                                  | Description                                                                                      |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [float3](/engine/7000.0/script-reference/unity/mathematics/float3.md) | The unit rotation axis of the input quaternion, or the x-axis if the quaternion is the identity. |

### Remarks

The result is the unit axis of the axis-angle representation of q. If q doesn't rotate, the axis is arbitrary and this function returns the x-axis. Use [math.angle](/engine/7000.0/script-reference/unity/mathematics/math/angle.md) to get the corresponding rotation angle.
