areCorrectPoints static method
Set the values of first and second if the tangent is in correct
direction, that is clockwise.
This is calculated by checking if the vector from first to second and
the vector second to radius are in the clockwise direction.
We check the direction of both by doing the cross product of both vectors.
Implementation
static bool areCorrectPoints(Coord first, Coord second, Coord center,
[bool clockwise = true, num errorTolerance = kDefaultError]) {
final line = second - first;
final radius = center - second;
final crossValue = line.cross(radius);
if (crossValue.abs() <= errorTolerance) return true;
return (crossValue < 0) == clockwise;
}