Implementation of the stroke stabilizer from OpenToonz project (SmoothStroke class in toonzrasterbrushtool.cpp), converted to the Swift language for the purpose of the ArtOverflow drawing app for Mac, and with a few changes. See documentation in RawInputStabilizer.swift for more details.