function calculateSagitta(data) {
  if (data[3] === 1) {
    return undefined;
  }
  const [rx, ry] = data;
  if (Math.abs(rx - ry) > error) {
    return undefined;
  }
  const chord = Math.hypot(data[5], data[6]);
  if (chord > rx * 2) {
    return undefined;
  }
  return rx - Math.sqrt(rx ** 2 - 0.25 * chord ** 2);
}
Calculates the sagitta of an arc if possible.

@see https://wikipedia.org/wiki/Sagitta_(geometry)#Formulas
@param {ReadonlyArray<number>} data
@returns {number | undefined}