def compute_chord(k0, k1):
    if k1 == 0:
        if k0 == 0:
            return 1
        else:
            return sin(k0 * .5) / (k0 * .5)
    sqrk1 = sqrt(2 * abs(k1))
    t0 = (k0 - .5 * k1) / sqrk1
    t1 = (k0 + .5 * k1) / sqrk1
    (y0, x0) = cornu.eval_cornu(t0)
    (y1, x1) = cornu.eval_cornu(t1)
    return hypot(y1 - y0, x1 - x0) / abs(t1 - t0)

# Given th0 and th1 at endpoints (measured from chord), return k0
# and k1 such that the clothoid k(s) = k0 + k1 s, evaluated from
# s = -.5 to .5, has the tangents given
dataset/ETHPy150Open google/roboto/third_party/spiro/curves/clothoid.py/compute_chord/original