distance function

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

Calculates the euclidian distance between two vec3's

@param {ReadonlyVec3} a the first operand @param {ReadonlyVec3} b the second operand @returns {Number} distance between a and b

Implementation

double distance(List<double> a, List<double> b) {
  final x = b[0] - a[0];
  final y = b[1] - a[1];
  final z = b[2] - a[2];
  return hypot([x, y, z]);
}