View Full Version : find the function
12-11-2009, 05:14 AM
if i have a set of 9 points how can i get the function???
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)
12-11-2009, 12:23 PM
If you want a polynomial function that pass through every point you can use the Newton polynomial function.
or the Lagrange form
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.
12-12-2009, 02:55 PM
it worked thanks alot
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.