# `Cauldron3D.Quat`
[🔗](https://github.com/jaman/cauldron/blob/v0.2.2/cauldron_3d/lib/cauldron_3d/quat.ex#L1)

Rotations as unit quaternions `{x, y, z, w}`.

    q = Cauldron3D.Quat.from_euler({0.0, 0.0, :math.pi() / 2})
    Cauldron3D.Quat.rotate(q, {1.0, 0.0, 0.0})
    #=> {0.0, 1.0, 0.0}

# `t`

```elixir
@type t() :: {float(), float(), float(), float()}
```

# `from_euler`

```elixir
@spec from_euler(Cauldron3D.Vec.t()) :: t()
```

The rotation turning `x` radians about the x axis, then `y` about the y axis, then `z`
about the z axis.

# `identity`

```elixir
@spec identity() :: t()
```

No rotation.

# `normalize`

```elixir
@spec normalize(t()) :: t()
```

`q` scaled to unit length.

# `rotate`

```elixir
@spec rotate(t(), Cauldron3D.Vec.t()) :: Cauldron3D.Vec.t()
```

`vector` turned by `q`.

# `slerp`

```elixir
@spec slerp(t(), t(), float()) :: t()
```

The rotation `t` of the way from `a` to `b`, along the shorter arc.

# `to_rows`

```elixir
@spec to_rows(t()) :: {Cauldron3D.Vec.t(), Cauldron3D.Vec.t(), Cauldron3D.Vec.t()}
```

The rotation as the rows of a 3 by 3 matrix.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
