def findmec_old(th0, th1):
    guess_ds = sqrt(6 * (th1 - th0))
    guess_savg = 2 * (th1 + th0) / guess_ds
    sm = .5 * (guess_savg - guess_ds)
    sp = .5 * (guess_savg + guess_ds)
    #sm, sp = th0, th1
    for i in range(1):
        actual_th0, actual_th1 = trymec(sm, sp)
        guess_dth = 1./6 * (sp - sm) ** 2
        guess_avth = .5 * (sp + sm) * (sp - sm)
        guess_th0 = .5 * (guess_avth - guess_dth)
        guess_th1 = .5 * (guess_avth + guess_dth)
        print sm, sp, actual_th0, actual_th1, guess_th0, guess_th1
dataset/ETHPy150Open google/roboto/third_party/spiro/curves/mecsolve.py/findmec_old/original