# quaternion

> Returns a quaternion constructed from four float values.

## Definition

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

## quaternion(float, float, float, float)

Returns a quaternion constructed from four float values.

```csharp
public static quaternion quaternion(float x, float y, float z, float w)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The x component of the quaternion.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The y component of the quaternion.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The z component of the quaternion.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The w component of the quaternion.

### Returns

| Type                                                                          | Description                                            |
| ----------------------------------------------------------------------------- | ------------------------------------------------------ |
| [quaternion](/engine/6000.7/script-reference/unity/mathematics/quaternion.md) | The quaternion constructed from individual components. |

## quaternion(float4)

Returns a quaternion constructed from a float4 vector.

```csharp
public static quaternion quaternion(float4 value)
```

### Parameters

**** (\[float4]\(/engine/6000.7/script-reference/unity/mathematics/float4)): The float4 containing the components of the quaternion.

### Returns

| Type                                                                          | Description                               |
| ----------------------------------------------------------------------------- | ----------------------------------------- |
| [quaternion](/engine/6000.7/script-reference/unity/mathematics/quaternion.md) | The quaternion constructed from a float4. |

## quaternion(float3x3)

Returns a unit quaternion constructed from a float3x3 rotation matrix. The matrix must be orthonormal.

```csharp
public static quaternion quaternion(float3x3 m)
```

### Parameters

**** (\[float3x3]\(/engine/6000.7/script-reference/unity/mathematics/float3x3)): The float3x3 rotation matrix.

### Returns

| Type                                                                          | Description                                        |
| ----------------------------------------------------------------------------- | -------------------------------------------------- |
| [quaternion](/engine/6000.7/script-reference/unity/mathematics/quaternion.md) | The quaternion constructed from a float3x3 matrix. |

## quaternion(float4x4)

Returns a unit quaternion constructed from a float4x4 matrix. The matrix must be orthonormal.

```csharp
public static quaternion quaternion(float4x4 m)
```

### Parameters

**** (\[float4x4]\(/engine/6000.7/script-reference/unity/mathematics/float4x4)): The float4x4 matrix (must be orthonormal).

### Returns

| Type                                                                          | Description                                        |
| ----------------------------------------------------------------------------- | -------------------------------------------------- |
| [quaternion](/engine/6000.7/script-reference/unity/mathematics/quaternion.md) | The quaternion constructed from a float4x4 matrix. |
