PDA

View Full Version : find the function

ahmed.abouraya
12-11-2009, 05:14 AM
if i have a set of 9 points how can i get the function???

Yomboprime
12-11-2009, 11:38 AM
If you have Px,y(1) to Px,y(N) points with x and y values, then
the linear function is F(x):

if x is between Px(i) and Px(i+1), then
a = ( x - Px(i) ) / ( Px(i+1) - Px(i) )
F(x)= Py(i) * a + Py(i+1) * ( 1 - a )

else if x < Px(1) then F(x) = Px(1)

else if x > Px(N) then F(x) = Px(N)

Rosario Leonardi
12-11-2009, 12:23 PM
If you want a polynomial function that pass through every point you can use the Newton polynomial function.
http://en.wikipedia.org/wiki/Newton_polynomial
or the Lagrange form
http://en.wikipedia.org/wiki/Lagrange_polynomial
But beware, with 9 point you can get a 9 grade polynomial that will rise very fast for number outside the interval of your point.

Otherwise if you want an approximation of the formula and you already know the distribution of your point you can use a least squares method.
http://en.wikipedia.org/wiki/Least_squares

ahmed.abouraya
12-12-2009, 02:55 PM
it worked thanks alot