I have 3 equations
$y_1=ax_1^2+bx_1+c$,
$y_2=ax_2^2+bx_2+c$,
$y_3=ax_3^2+bx_3+c$
i.e. 3 pairs of values $x_1$,$y_1$, $x_2$,$y_2$ and $x_3$,$y_3$ and I need to fit the curve. I found lots of code for $n$ pairs using matrices but really just have this simple case of 3
I need $a,b,c$ in terms of the paired values.
There must be a simple equation?
d1=(r1-r2)(r1-r3) d2=(r2-r1)(r2-r3) d3=(r3-r1)*(r3-r2)
a=t1/d1+t2/d2+t3/d3 b=t1(-x2-x3)/d1 + t2(-x1-x3)/d2 + t3(-x1-x2)/d3 c=t1(-x2(-x3))/d1 + t2(-x1(-x3))/d2 + t3(-x1*(-x2))/d3
print,a print,b print,c
is the answer if i did my algebra right!
– geoff123 Nov 05 '14 at 11:56