I\'ve three sets of data such as:
x y
4 0
6 60
8 0
Does anyone know any (efficient) Java codes that can give me back the values of a, b
The LaGrange interpolation is probably the most 'efficient' (how do you measure that?) solution you are going to find. So I'll suggest a completely general code. You did want code, right? This code can go linear, quadratic, cubic, .... for any number of points.
I didn't actually try to compile it, so I don't if the source code is up to date. You know how online demos go. Yet the applet from the associated web page is fully functional. The jar file will run standalone. With a resizable window, you really don't need to customize it.