public class AnglesClassifier
extends StrokeClassifier
A classifier which calculates the variance of differences between successive angles in a stroke.
For each stroke it keeps its last three points. If some successive points are the same, it
ignores the repetitions. If a new point is added, the classifier calculates the angle between
the last three points. After that, it calculates the difference between this angle and the
previously calculated angle. Then it calculates the variance of the differences from a stroke.
To the differences there is artificially added value 0.0 and the difference between the first
angle and PI (angles are in radians). It helps with strokes which have few points and punishes
more strokes which are not smooth.
This classifier also tries to split the stroke into two parts in the place in which the biggest
angle is. It calculates the angle variance of the two parts and sums them up. The reason the
classifier is doing this, is because some human swipes at the beginning go for a moment in one
direction and then they rapidly change direction for the rest of the stroke (like a tick). The
final result is the minimum of angle variance of the whole stroke and the sum of angle variances
of the two parts split up. The classifier tries the tick option only if the first part is
shorter than the second part.
Additionally, the classifier classifies the angles as left angles (those angles which value is
in [0.0, PI - ANGLE_DEVIATION) interval), straight angles
([PI - ANGLE_DEVIATION, PI + ANGLE_DEVIATION] interval) and right angles
((PI + ANGLE_DEVIATION, 2 * PI) interval) and then calculates the percentage of angles which are
in the same direction (straight angles can be left angels or right angles)