# `Visualize.Shape.Curve`
[🔗](https://github.com/dcoai/Visualize/blob/v0.8.3/lib/visualize/shape/curve.ex#L1)

Curve interpolators for line and area generators.

Curves define how points are connected in a path.

# `curve_type`

```elixir
@type curve_type() ::
  :linear
  | :step
  | :step_before
  | :step_after
  | :basis
  | :cardinal
  | :catmull_rom
  | :monotone_x
  | :monotone_y
  | :natural
  | :cardinal_closed
  | :basis_closed
```

# `point`

```elixir
@type point() :: {number(), number()}
```

# `basis`

```elixir
@spec basis([point()]) :: Visualize.IR.Path.t()
```

Basis spline interpolation

# `basis_closed`

```elixir
@spec basis_closed([point()]) :: Visualize.IR.Path.t()
```

The B-spline as a closed loop (spec/04 §5.3, #393): d3-shape's curveBasisClosed

# `cardinal`

```elixir
@spec cardinal([point()], number()) :: Visualize.IR.Path.t()
```

Cardinal spline interpolation

# `cardinal_closed`

```elixir
@spec cardinal_closed([point()], number()) :: Visualize.IR.Path.t()
```

The cardinal spline as a closed loop (spec/04 §5.3, #393): d3-shape's curveCardinalClosed

# `catmull_rom`

```elixir
@spec catmull_rom([point()], number()) :: Visualize.IR.Path.t()
```

Catmull-Rom spline interpolation

# `generate`

```elixir
@spec generate(curve_type(), [point()], keyword()) :: Visualize.IR.Path.t()
```

Generates path commands for a list of points using the specified curve type.

# `linear`

```elixir
@spec linear([point()]) :: Visualize.IR.Path.t()
```

Linear interpolation - straight lines between points

# `monotone_x`

```elixir
@spec monotone_x([point()]) :: Visualize.IR.Path.t()
```

Monotone interpolation in x (preserves monotonicity)

# `monotone_y`

```elixir
@spec monotone_y([point()]) :: Visualize.IR.Path.t()
```

Monotone interpolation in y (preserves monotonicity)

# `natural`

```elixir
@spec natural([point()]) :: Visualize.IR.Path.t()
```

Natural cubic spline interpolation.

The spline through every point with zero second derivative at both ends, as d3-shape's
`curveNatural`. The Bézier control points come from the tridiagonal system solved by
`control_points/1`, once for the x coordinates and once for the y coordinates.

# `step`

```elixir
@spec step([point()], number()) :: Visualize.IR.Path.t()
```

Step interpolation with configurable step position

---

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