function getIntersections(arr_a, arr_b, ids = []) {
  let intersections = [];

  for (let i = 0; i < arr_a.length; i++) {
    let el_a = arr_a[i];

    for (let j = 0; j < arr_b.length; j++) {
      let el_b = arr_b[j];

      if (isPointCoordinates(el_a) && isPointCoordinates(el_b)) {
        if (el_a[0] === el_b[0] && el_a[1] === el_b[1]) {
          let new_intersection;

          if (ids.length === 2) {
            let identified_intersections = {};
            (identified_intersections[ids[0]] = i),
              (identified_intersections[ids[1]] = j),
              (new_intersection = [el_a, identified_intersections]);
          } else {
            new_intersection = el_a;
          }

          intersections.push(new_intersection);
        }
      } else {
        throw new Error(
          "Every element of each array must be a coordinate pair array.",
        );
      }
    }
  }

  return intersections;
}
Given two coordinate arrays, get their intersections.

@param {array<array<number>>} arr_a - Array of coordinate pairs.
@param {array<array<number>>} arr_b - Array of coordinate pairs.
@param {array<number>} ids - 2-element array whose elements are IDs for arr_a and arr_b respectively.

@returns {Array<Array<number|Object<number, number>>>} - Array whose elements are the intersections' cooridinate-pairs if
ids is empty, or otherwise whose elements are arrays each of whose first element is an
intersection's coordinate-pair and whose second element is an object mapping each array's ID (supplied by ids)
to the index of the intersection's coordinate-pair in that array.