approximatelyEqual static method
Implementation
static bool approximatelyEqual(Vec2D a, Vec2D b, {double threshold = 0.001}) {
var a0 = a.x, a1 = a.y;
var b0 = b.x, b1 = b.y;
return (a0 - b0).abs() <=
threshold * math.max(1.0, math.max(a0.abs(), b0.abs())) &&
(a1 - b1).abs() <=
threshold * math.max(1.0, math.max(a1.abs(), b1.abs()));
}