def compute_join_angle(px, py):
    from scipy.integrate import quad
    xp = polyder(px, 1)
    yp = polyder(py, 1)
    integrand = (lambda t: arctan2(polyval(yp, t), polyval(xp, t)))
    return quad(integrand, 0, 1)[0]
def compute_join_angle(px, py):
    from scipy.integrate import quad
    xp = polyder(px, 1)
    yp = polyder(py, 1)
    integrand = (lambda t: arctan2(polyval(yp, t), polyval(xp, t)))
    return quad(integrand, 0, 1)[0]