An angle scale: a cyclic quantity (a compass bearing, an hour of the day, a day of the year) to radians (spec/06 §15, visualize D-30).
The mapping is Macaw.Draw.Scale.Linear's with a range in radians, one full turn by
default. Angles follow Macaw.Draw.Shape.Arc's convention, clockwise from 12 o'clock, so
a bearing domain [0, 360] puts north at the top and east at the right. ticks/2 are
exactly count equal divisions of the domain, not the nice-step sequence, and nice/1
is identity: the domain of a cyclic quantity is its period.
bearing = Macaw.Draw.Scale.Radial.new() |> Macaw.Draw.Scale.Radial.domain!([0, 360])
Macaw.Draw.Scale.Radial.ticks(bearing, 4)
#=> [0.0, 90.0, 180.0, 270.0]
Summary
Functions
The angle of a domain value: Macaw.Draw.Scale.Linear.apply/2 over the domain and range.
0: a radial scale has no bandwidth.
Sets clamping; answers the struct.
Sets the domain, two numbers: {:ok, scale} or {:error, faults}.
domain/2, answering the scale or raising Macaw.Draw.Error.
The domain value of an angle: Macaw.Draw.Scale.Linear.invert/2; never clamps.
A radial scale: domain [0, 1], range [0, 2π].
Identity: the domain of a cyclic quantity is its period.
Identity: a radial scale has no padding.
Sets the range, two angles in radians: {:ok, scale} or {:error, faults}.
range/2, answering the scale or raising Macaw.Draw.Error.
Exactly count equal divisions of the domain from d0: the last, d1, omitted when
the range is a full turn, where it falls on the first, and kept otherwise. A count below
1 answers [] (spec/06 §15.2).
Types
@type error() :: {:error, [Macaw.Base.Fault.t()]}
A refusal: faults with their paths.
Functions
The angle of a domain value: Macaw.Draw.Scale.Linear.apply/2 over the domain and range.
0: a radial scale has no bandwidth.
Sets clamping; answers the struct.
Sets the domain, two numbers: {:ok, scale} or {:error, faults}.
domain/2, answering the scale or raising Macaw.Draw.Error.
The domain value of an angle: Macaw.Draw.Scale.Linear.invert/2; never clamps.
@spec new() :: t()
A radial scale: domain [0, 1], range [0, 2π].
Identity: the domain of a cyclic quantity is its period.
Identity: a radial scale has no padding.
Sets the range, two angles in radians: {:ok, scale} or {:error, faults}.
range/2, answering the scale or raising Macaw.Draw.Error.
Exactly count equal divisions of the domain from d0: the last, d1, omitted when
the range is a full turn, where it falls on the first, and kept otherwise. A count below
1 answers [] (spec/06 §15.2).