function equals(a, b) {
  if (typeof a !== 'object' || typeof b !== 'object') {
    return a === b;
  }
  return a.x === b.x && a.y === b.y && a.z === b.z && a.w === b.w;
}
Compares the values of two coordinates to check equality.

@param {object|string} a - An object with keys [x y z].
@param {object|string} b - An object with keys [x y z].
@returns {boolean} True if both coordinates are equal, false otherwise