Using a polygon area calculation, it's incredibly simple to determine if a buffer of x,y mouse coords is technically, mathematically moving clockwise, or counterclockwise:
let dir = Math.sign(coords.reduce((prev, coord, i) => prev +
(coords[i+1].x - coord.x) *
(coords[i+1].y + coord.y),0
))
But that simple code will always return either clockwise or counterclockwise, which isn't practically what ought to be the correct result.
Rapid up-and-down, or left-and-right motions, or very approximately straight lines, may technically be moving clockwise, but aren't moving clockwise in the common understanding of clockwise - there isn't an option for "NEITHER".
Is there a way to adjust that calculation to quickly determine if the 'clockwise-ness' is beyond a certain threshold?