# `Macaw.Draw.Ease`
[🔗](https://github.com/dcoai/macaw_draw/blob/v0.1.0/lib/macaw/draw/ease.ex#L1)

The 25 easing curves (spec/07 §18), copied from visualize's `Visualize.Ease`: functions
from `t` in `[0, 1]` to a float, nominally in `[0, 1]` (the `elastic_*` and `back_*`
families overshoot).

    iex> Macaw.Draw.Ease.quad_in(0.5)
    0.25
    iex> {:ok, ease} = Macaw.Draw.Ease.by_name("cubic_in_out")
    iex> ease.(0.5)
    0.5

The exact-endpoint clauses match the **integer** literals `0` and `1` only; the floats
`0.0` and `1.0` take the formula (`exp_in(0.0)` is `2^−10`). `by_name/1` reads a name by
spelling and refuses an unknown one as `{[], {:unknown, :ease, spelling}}`, where
visualize raised; `frames/2` samples a curve at evenly spaced `t`.

Every easing answers a value for any number: a `t` that is no number is
`{[], {:type, :number}}`, and one outside `[0, 1]` where the curve is undefined or past a
float's range (a circle's square root of a negative, an exponential's overflow) is
`{[], {:domain, t}}`.

# `error`

```elixir
@type error() :: {:error, [Macaw.Base.Fault.t()]}
```

A refusal: faults with their paths.

# `back_in`

```elixir
@spec back_in(number()) :: float() | error()
```

The `back_in` easing of `t` (spec/07 §18).

# `back_in`

```elixir
@spec back_in(number(), number()) :: float() | error()
```

`back_in` with the overshoot `s` in place of `1.70158`.

# `back_in_out`

```elixir
@spec back_in_out(number()) :: float() | error()
```

The `back_in_out` easing of `t` (spec/07 §18).

# `back_out`

```elixir
@spec back_out(number()) :: float() | error()
```

The `back_out` easing of `t` (spec/07 §18).

# `back_out`

```elixir
@spec back_out(number(), number()) :: float() | error()
```

`back_out` with the overshoot `s` in place of `1.70158`.

# `bounce_in`

```elixir
@spec bounce_in(number()) :: float() | error()
```

The `bounce_in` easing of `t` (spec/07 §18).

# `bounce_in_out`

```elixir
@spec bounce_in_out(number()) :: float() | error()
```

The `bounce_in_out` easing of `t` (spec/07 §18).

# `bounce_out`

```elixir
@spec bounce_out(number()) :: float() | error()
```

The `bounce_out` easing of `t` (spec/07 §18).

# `by_name`

```elixir
@spec by_name(term()) :: {:ok, (number() -&gt; term())} | error()
```

The easing of a name, an atom or its string read by spelling: `{:ok, fun}`, or
`{:error, [{[], {:unknown, :ease, spelling}}]}`.

# `circle_in`

```elixir
@spec circle_in(number()) :: float() | error()
```

The `circle_in` easing of `t` (spec/07 §18).

# `circle_in_out`

```elixir
@spec circle_in_out(number()) :: float() | error()
```

The `circle_in_out` easing of `t` (spec/07 §18).

# `circle_out`

```elixir
@spec circle_out(number()) :: float() | error()
```

The `circle_out` easing of `t` (spec/07 §18).

# `cubic_in`

```elixir
@spec cubic_in(number()) :: float() | error()
```

The `cubic_in` easing of `t` (spec/07 §18).

# `cubic_in_out`

```elixir
@spec cubic_in_out(number()) :: float() | error()
```

The `cubic_in_out` easing of `t` (spec/07 §18).

# `cubic_out`

```elixir
@spec cubic_out(number()) :: float() | error()
```

The `cubic_out` easing of `t` (spec/07 §18).

# `elastic_in`

```elixir
@spec elastic_in(number()) :: float() | error()
```

The `elastic_in` easing of `t` (spec/07 §18).

# `elastic_in_out`

```elixir
@spec elastic_in_out(number()) :: float() | error()
```

The `elastic_in_out` easing of `t` (spec/07 §18).

# `elastic_out`

```elixir
@spec elastic_out(number()) :: float() | error()
```

The `elastic_out` easing of `t` (spec/07 §18).

# `exp_in`

```elixir
@spec exp_in(number()) :: float() | error()
```

The `exp_in` easing of `t` (spec/07 §18).

# `exp_in_out`

```elixir
@spec exp_in_out(number()) :: float() | error()
```

The `exp_in_out` easing of `t` (spec/07 §18).

# `exp_out`

```elixir
@spec exp_out(number()) :: float() | error()
```

The `exp_out` easing of `t` (spec/07 §18).

# `frames`

```elixir
@spec frames(term(), integer()) :: [term()] | error()
```

`count` values of an easing, named or a 1-arity function, at `t = i / (count − 1)` for
`i` in `0..count − 1` when `count > 1`, and `[1.0]` for a count of 1 or less;
`{:error, faults}` for an unknown name.

# `linear`

```elixir
@spec linear(number()) :: float() | error()
```

The `linear` easing of `t` (spec/07 §18).

# `names`

```elixir
@spec names() :: [atom()]
```

The 25 names, in spec/07 §18's order.

# `poly_in`

```elixir
@spec poly_in(number(), number()) :: float() | error()
```

`t^e`, exponent 3 by default.

# `poly_in_out`

```elixir
@spec poly_in_out(number(), number()) :: float() | error()
```

`2^(e−1)·t^e` below one half, else `1 − (−2t + 2)^e / 2`; exponent 3 by default.

# `poly_out`

```elixir
@spec poly_out(number(), number()) :: float() | error()
```

`1 − (1 − t)^e`, exponent 3 by default.

# `quad_in`

```elixir
@spec quad_in(number()) :: float() | error()
```

The `quad_in` easing of `t` (spec/07 §18).

# `quad_in_out`

```elixir
@spec quad_in_out(number()) :: float() | error()
```

The `quad_in_out` easing of `t` (spec/07 §18).

# `quad_out`

```elixir
@spec quad_out(number()) :: float() | error()
```

The `quad_out` easing of `t` (spec/07 §18).

# `sin_in`

```elixir
@spec sin_in(number()) :: float() | error()
```

The `sin_in` easing of `t` (spec/07 §18).

# `sin_in_out`

```elixir
@spec sin_in_out(number()) :: float() | error()
```

The `sin_in_out` easing of `t` (spec/07 §18).

# `sin_out`

```elixir
@spec sin_out(number()) :: float() | error()
```

The `sin_out` easing of `t` (spec/07 §18).

---

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