equals function

bool equals(
  1. List<double> a,
  2. List<double> b
)

Returns whether or not the matrices have approximately the same elements in the same position.

@param {ReadonlyMat4} a The first matrix. @param {ReadonlyMat4} b The second matrix. @returns {Boolean} True if the matrices are equal, false otherwise.

Implementation

bool equals(List<double> a, List<double> b) {
  final a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3];
  final a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7];
  final a8 = a[8], a9 = a[9], a10 = a[10], a11 = a[11];
  final a12 = a[12], a13 = a[13], a14 = a[14], a15 = a[15];

  final b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3];
  final b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7];
  final b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11];
  final b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15];

  return ((a0 - b0).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a0), (b0).abs())) &&
      (a1 - b1).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a1), (b1).abs())) &&
      (a2 - b2).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a2), (b2).abs())) &&
      (a3 - b3).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a3), (b3).abs())) &&
      (a4 - b4).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a4), (b4).abs())) &&
      (a5 - b5).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a5), (b5).abs())) &&
      (a6 - b6).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a6), (b6).abs())) &&
      (a7 - b7).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a7), (b7).abs())) &&
      (a8 - b8).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a8), (b8).abs())) &&
      (a9 - b9).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a9), (b9).abs())) &&
      (a10 - b10).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a10), (b10).abs())) &&
      (a11 - b11).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a11), (b11).abs())) &&
      (a12 - b12).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a12), (b12).abs())) &&
      (a13 - b13).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a13), (b13).abs())) &&
      (a14 - b14).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a14), (b14).abs())) &&
      (a15 - b15).abs() <= GlMatrix.EPSILON * math.max(1.0, math.max((a15), (b15).abs())));
}