/**
 * Divide two complex numbers
 * @param {number[]} result
 * @param {number[]} a
 * @param {number[]} b
 */
export function complex_div(result, a, b) {
    const sqr_norm_b = b[0] * b[0] + b[1] * b[1];

    result[0] = (a[0] * b[0] + a[1] * b[1]) / sqr_norm_b;
    result[1] = (a[1] * b[0] - a[0] * b[1]) / sqr_norm_b;
}