[Gambas-user] Polynomiale Least Square

Tobias Boege taboege at ...626...
Tue Apr 18 11:55:51 CEST 2017


On Tue, 18 Apr 2017, cheikh diabang wrote:
> Hello. I would like to write gambas code which determines the polynomial of a set of x, y coordinates. Is there anyone who has used it to help me please.

If your polynomial has real or complex coefficients you can use gb.gsl's [1]
Polynomial class. But while the documentation says arithmetic operators are
overloaded in gb.gsl, this isn't entirely true for polynomials. In particular
multiplication of polynomials is not supported. You have to implement that
yourself using the array accessors. Addition and multiplication of polynomials
is all you need for Lagrange polynomials [2] which solve your interpolation
problem. I have done it before, it's straightforward.

Regards,
Tobi

[1] http://gambaswiki.org/wiki/comp/gb.gsl
[2] https://en.wikipedia.org/wiki/Lagrange_polynomial

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list