9.3
56.12 Choosing a speed curve
An easing function maps elapsed progress to animation progress.
procedure
(linear-reveal-front direction [ #:origin origin #:padding padding]) → linear-reveal-front? direction : vec2? origin : (or/c 'automatic vec2?) = 'automatic padding : (and/c finite-real? (>=/c 0)) = 1/20
Constructs a deterministic half-plane reveal front. direction must be
finite and nonzero and is normalized once at construction. 'automatic
uses the frozen layout-box center as the sweep reference; an explicit
vec2 supplies a local reference point. Padding is a nonnegative
fraction of the larger frozen-box dimension.
procedure
(linear-reveal-front? value) → boolean?
value : any/c
Recognizes a linear reveal front.
procedure
(rate-function? value) → boolean?
value : any/c
Returns #t when value is a built-in callable semantic rate
function.
procedure
(rate-function-name value) → symbol?
value : rate-function?
Returns the stable built-in kind, such as 'smooth.
procedure
(rate-function-parameters value) → list?
value : rate-function?
Returns the validated constructor parameters in their stable order.
procedure
(rate-function->datum value) → pair?
value : rate-function?
Returns a compact serializable description, for example
'(smooth 10).
procedure
(rate-function-apply value progress) → finite-real?
value : rate-function? progress : finite-real?
Applies one semantic rate function. The scene machinery supplies clamped
progress; built-ins return exact 0 or 1 at the corresponding clip boundaries.
value
procedure
(smooth [#:inflection inflection]) → rate-function?
inflection : positive-real? = 10
Returns a normalized logistic S curve. Greater inflection makes its
departure from zero and arrival at one sharper.
procedure
Returns the cubic 3t2-2t3 curve with zero slope at both endpoints.
procedure
Returns a smooth curve that starts slowly and accelerates into its endpoint.
procedure
Returns a smooth curve that leaves quickly and decelerates toward its endpoint.
procedure
Returns a smooth excursion from zero to one and back to zero.
procedure
(there-and-back-with-pause [#:pause-ratio pause-ratio])
→ rate-function? pause-ratio : (and/c finite-real? (>=/c 0) (</c 1)) = 1/3
Returns an outward-and-returning curve that holds one for the specified fraction
of its unit interval.
procedure
(reverse-rate function) → rate-function?
function : rate-function?
Returns the time reversal of a semantic rate function.
procedure
(compose-rate first rest ...) → rate-function?
first : rate-function? rest : rate-function?
procedure
(squish-rate function [#:from from #:to to]) → rate-function?
function : rate-function? from : (and/c finite-real? (>=/c 0) (<=/c 1)) = 0 to : (and/c finite-real? (>=/c 0) (<=/c 1)) = 1
Runs function only over the strict interval from from to
to, holding zero before it and one after it.