plot/interval
src/plot/interval.tur
defstruct
FunctionIntervalR
(defstruct FunctionIntervalR :copy [f1 : (fn [float])
the band between y = f1(x) and y = f2(x).
defstruct
LinesIntervalR
(defstruct LinesIntervalR :copy [lower : (Vec Point) upper : (Vec Point) fill : FillStyle style : LineStyle label : cstr])
the band between two point lists: it runs along
defstruct
ParametricIntervalR
(defstruct ParametricIntervalR :copy [f1 : (fn [float])
the band between two parametric curves, Points f(t).
defstruct
PolarIntervalR
(defstruct PolarIntervalR :copy [f1 : (fn [float])
the band between two polar curves radius = f(theta).
defn
function-interval
(function-interval [^fat f1 : (fn [float])
shade between f1(x) and f2(x).
Parameters
| f1 | the lower curve, a (fn [float] float) | |
| f2 | the upper curve, a (fn [float] float) | |
| x-min | start of the sampled domain | |
| x-max | end of the sampled domain | |
| samples | sample count (at least 32 are drawn) | |
| fill | the FillStyle of the band | |
| style | the LineStyle of its outline | |
| label | legend text ("" for none) |
Returns
A FunctionIntervalR boxed as an AnyRenderer.
Example
(function-interval lo hi -1.0 1.0 96 (default-fill-style) (default-line-style) "band")
defn
lines-interval
(lines-interval [vs1 : (Vec Point) vs2 : (Vec Point) fill : FillStyle style : LineStyle label : cstr] :)
shade between two sampled line lists.
Parameters
| vs1 | the points along one edge | |
| vs2 | the points along the other, same x order (their y is used) | |
| fill | the FillStyle of the band | |
| style | the LineStyle of its outline | |
| label | legend text ("" for none) |
Returns
A LinesIntervalR boxed as an AnyRenderer.
Example
(lines-interval lo-pts hi-pts (default-fill-style) (default-line-style) "ci")
defn
parametric-interval
(parametric-interval [^fat f1 : (fn [float])
shade between two parametric curves.
Parameters
| f1 | one edge, a (fn [float] Point) | |
| f2 | the other edge, likewise | |
| t-min | start of the parameter range | |
| t-max | end of the parameter range | |
| samples | sample count (at least 32 are drawn) | |
| fill | the FillStyle of the band | |
| style | the LineStyle of its outline | |
| label | legend text ("" for none) |
Returns
A ParametricIntervalR boxed as an AnyRenderer.
Example
(parametric-interval inner outer 0.0 1.0 72 (default-fill-style) (default-line-style) "")
defn
polar-interval
(polar-interval [^fat f1 : (fn [float])
shade between two polar curves.
Parameters
| f1 | the inner radius, a (fn [float] float) of theta | |
| f2 | the outer radius, likewise | |
| theta-min | start of the angle range, in radians | |
| theta-max | end of the angle range, in radians | |
| samples | sample count (at least 32 are drawn) | |
| fill | the FillStyle of the band | |
| style | the LineStyle of its outline | |
| label | legend text ("" for none) |
Returns
A PolarIntervalR boxed as an AnyRenderer.
Example
(polar-interval r-in r-out 0.0 3.14 72 (default-fill-style) (default-line-style) "")
Internal definitions
__draw-lines-interval-- fill (then outline) the band between two lowered point lists.__draw-function-interval-- the function-interval band, through __draw-curve-interval.__draw-parametric-interval-- the parametric-interval band, through __draw-curve-interval.__draw-polar-interval-- the polar-interval band, through __draw-curve-interval.Renderer[FunctionIntervalR]Renderer[LinesIntervalR]Renderer[ParametricIntervalR]Renderer[PolarIntervalR]