Results (
Thai) 1:
[Copy]Copied!
4.2.2. The Functor Toolbox. The Imager toolboxfurnishes a set of simple functors, including oneparameterfunctors such as polynomial (linear, quadratic,etc.), transcendental (sine, cosine), as well as variousalgebraic two-parameter functors, used for combiningfunctors in intuitive ways.Perhaps the most flexible type of functor is theenvelope functor. This type of functor encapsulates a setof samples of a function. Its appeal derives in part fromthe fact that the function can be drawn graphically (in“freehand”), without needing to know its precisemathematical form. It can be particularly effective indescribing motion trajectories in 2-space: the artist simplydraws the desired path.4.2.3. Visual Representation of Functors inSonnet+Imager. In the context of Sonnet’s visuallanguage, functors appear in three forms: as individualprimitive components, as circuits or chips, and as packets.This representation has two advantages. First, thecircuit metaphor employed by Sonnet allows functors tobe “hooked up” to suitable clients using simple “wires”.No code needs to be written. Type safety is guaranteed bySonnet’s normal type-checking mechanism.Second, more elaborate functors can be composedfrom simpler ones by wiring functors together intocircuits. For example, a “wobbling spiral” path can beconstructed by combining two primitive functors (awobble functor, and a Fermat’s spiral functor) with anadditive composition functor, as shown in Figure 7. The
packet produced at the adder’s output is itself a functor,
which is called by an additional component at the
appropriate times to produce its result.
Being translated, please wait..
