def fit_parabola(x1,x2,x3,y1,y2,y3):
    """Returns the parabola coefficients a,b,c given 3 data points [y(x)=a*x**2+b*x+c]"""
    denom = (x1-x2)*(x1-x3)*(x2-x3)
    a = (x3*(y2-y1)+x2*(y1-y3)+x1*(y3-y2))/denom
    b = (x1**2*(y2-y3)+x3**2*(y1-y2)+x2**2*(y3-y1))/denom
    c = (x2**2*(x3*y1-x1*y3)+x2*(x1**2*y3-x3**2*y1)+x1*x3*(x3-x1)*y2)/denom
    return a,b,c