function getMiddleOrTop(first, last) {
    return Math.round((first[axis] + last[axis] + last[dimension]) / 2);
  }
Get point on relevant axis for given alignment.

@param {Alignment} type
@param {Element[]} sortedElements

@return {Partial<Record<Alignment, number>>}