almostEquals method

bool almostEquals(
  1. Vec3 vector, [
  2. double? precision
])

Check if a vector equals is almost equal to another one.

Implementation

bool almostEquals(Vec3 vector,[double? precision]) {
  precision ??= 1e-6;
  if (
    (x - vector.x).abs() > precision ||
    (y - vector.y).abs() > precision ||
    (z - vector.z).abs() > precision
  ) {
    return false;
  }
  return true;
}