def trymec(sm, sp):
    xys, thm, cost = run_elastica_half(abs(sm), 0, 1, 0, 10)
    xm, ym, km = xys[-1]
    if sm < 0:
        xm = -xm
        ym = -ym
        thm = -thm
    xys, thp, cost = run_elastica_half(abs(sp), 0, 1, 0, 10)
    xp, yp, kp = xys[-1]
    if sp < 0:
        xp = -xp
        yp = -yp
        thp = -thp
    chth = atan2(yp - ym, xp - xm)
    #print xm, ym, xp, yp, chth, thm, thp
    actual_th0 = chth - thm
    actual_th1 = thp - chth
    return actual_th0, actual_th1
dataset/ETHPy150Open google/roboto/third_party/spiro/curves/mecsolve.py/trymec/original