function getCoordinate(coordinates, index) {
  const count = coordinates.length;
  if (index < 0) {
    return coordinates[index + count];
  }
  if (index >= count) {
    return coordinates[index - count];
  }
  return coordinates[index];
}
@param {LineCoordType} coordinates The ring coordinates.
@param {number} index The index.  May be wrapped.
@return {import("../coordinate.js").Coordinate} The coordinate.