raw input
wobble smoother
upsampled
position modeling
The position of the pen is modeled as a weight connected by a spring
to an anchor.
The anchor moves along the resampled dewobbled inputs,
pulling the weight along with it across a surface, with some amount of
friction. Euler integration is used to solve for the position of the
pen.
The physical model that is used to model the stroke is the following
where
is time
is the position of the pen
is the position of the anchor
and
are constants that sets how the spring and drag occurs
is given by position_modeler_spring_mass_constant and
by position_modeler_drag_constant
We will thus have as input the upsampled dewobbled inputs
taking the role of discretized
and
will be the output
Modeling a stroke.
Input : input stream
Output : smoothed stream
We define
.
An euler scheme integration scheme is used with the initial conditions
being
and
(same initial conditions)
Update rule is simply
The position
is the main thing to export but we can also export speed and
acceleration if needed. We denote
and this will be our output with