View Full Version : find the function
12-11-2009, 06:14 AM
if i have a set of 9 points how can i get the function???
12-11-2009, 12:38 PM
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, 01: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, 03:55 PM
it worked thanks alot
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.