function randomOrthogonalVector (N, orthog, type) {
    const big = type === 'BigNumber'
    const cplx = type === 'Complex'

    // generate random vector with the correct type
    let v = Array(N).fill(0).map(_ => 2 * Math.random() - 1)
    if (big) { v = v.map(n => bignumber(n)) }
    if (cplx) { v = v.map(n => complex(n)) }

    // project to orthogonal complement
    v = orthogonalComplement(v, orthog)

    // normalize
    return normalize(v, type)
  }
Generates a random unit vector of dimension N, orthogonal to each vector in the list
@template T
@param {number} N dimension
@param {T[][]} orthog list of vectors
@param {'number'|'BigNumber'|'Complex'} type
@returns {T[]} random vector