# `Visualize.Scale.Radial`
[🔗](https://github.com/dcoai/Visualize/blob/v0.8.3/lib/visualize/scale/radial.ex#L1)

An angle scale: a cyclic domain — bearing, hour of day, day of year — to radians
(spec/03 §14, D-30).

The mapping is `Visualize.Scale.Linear`'s with a range in radians, one full turn by
default; angles follow `Visualize.Shape.Arc`'s convention, clockwise from 12 o'clock, so a
bearing domain `[0, 360]` needs no offset. `ticks/2` returns `count` equal divisions of
the domain — exact, not the nice-step sequence — and `nice/1` is identity: the domain of
a cyclic quantity is its period.

    bearing = Visualize.Scale.radial() |> Visualize.Scale.domain([0, 360])
    Visualize.Scale.apply(bearing, 90)      # => π/2
    Visualize.Scale.ticks(bearing, 4)       # => [0.0, 90.0, 180.0, 270.0]

# `t`

```elixir
@type t() :: %Visualize.Scale.Radial{
  clamp?: boolean(),
  domain: [number()],
  range: [number()]
}
```

# `apply`

```elixir
@spec apply(t(), number()) :: float()
```

Maps a domain value to radians

# `bandwidth`

```elixir
@spec bandwidth(t()) :: 0
```

Returns `0`: a radial scale has no bandwidth

# `clamp`

```elixir
@spec clamp(t(), boolean()) :: t()
```

Enables or disables clamping

# `domain`

```elixir
@spec domain(t(), [number()]) :: t()
```

Sets the domain

# `invert`

```elixir
@spec invert(t(), number()) :: float()
```

Maps radians back to the domain; never clamps

# `new`

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

Creates a radial scale: domain `[0, 1]`, range `[0, 2π]`

# `nice`

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

Identity: the domain of a cyclic quantity is its period

# `padding`

```elixir
@spec padding(t(), number()) :: t()
```

Identity: a radial scale has no padding

# `range`

```elixir
@spec range(t(), [number()]) :: t()
```

Sets the range, in radians

# `ticks`

```elixir
@spec ticks(t(), integer()) :: [float()]
```

Returns `count` equal divisions of the domain from `d0`.

The last division, `d1`, is dropped when the range is a full turn — it coincides with
the first on the circle — and kept otherwise. `count <= 0` yields `[]`.

---

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