Some arguments to flametree_grow() take numeric input, but
seg_col, seg_wid, shift_x, and shift_y all
take functions as their input, and are used to
control how the colours (seg_col) and width (seg_wid) of the
segments are created, as well as the horizontal (shift_x) and
vertical (shift_y) displacement of the trees are generated. Functions
passed to these arguments take four inputs: coord_x, coord_y,
id_tree, and id_time as input. Any function that takes
these variables as input and produces a numeric vector of the same length
as the input can be used for this purpose. However, as a
convenience, four "spark" functions are provided that can be used to create
functions that are suitable for this purpose: spark_linear(),
spark_decay(), spark_random(), and spark_nothing().
Arguments passed to one of the spark functions determine the specific
function is generated. For example, spark_linear() can be used to
construct any linear combination of the inputs:
spark_linear(x = 3, y = 2) would return a function that computes
the sum (3 * coord_x) + (2 * coord_y). Different values provided as
input produce different linear functions. Analogously, spark_decay()
returns functions that are exponentially decaying functions of a linear
combination of inputs. The spark_random() generator can be used to
generate functions that return random values, and spark_nothing()
produces a function that always returns zero regardless of input.