Stroke end
The position modeling algorithm will lag behind the raw input by some
distance. This algorithm iterates the previous dynamical system a few
additional time using the raw input position as the anchor to allow a
catch up of the stroke (though this prediction is only
given by predict, so is not part of the
results and becomes obsolete on the next input).
Algorithm :Stroke end
Input:
-
Final anchor position
(From the original input stream)
-
final tip state
(returned from the physical modeling from the last section,
signifies that we are looking at the filtered output)
-
max number of iterations
(sampling_end_of_stroke_max_iterations)
-
the target time delay between stroke
(1/sampling_min_output_rate)
-
stopping distance
(sampling_end_of_stroke_stopping_distance)
-
and
the modeling coefficients
initialize the vector
with
initialize
for
- calculate the next candidate
- if
(further iterations won’t be able to catch up and won’t move closer to
the anchor, we stop here), - return
- endif
-
if
(we’ve overshot the anchor, we retry with a smaller step)
-
,
-
continue (this candidate will be discarded, try
again with a smaller time step instead),
- else
-
(We append the result to the end of the
vector)
- endif
Output :