# Taylor series for Arduino

Hello everyone,

I'm trying to develop a system to calculate the moisture present in a seed.

My project is:

I have several samples of seeds that I know humidity (ranging from 0 to 100%). I scan these seeds with a sensor connected to my Arduino, and I save these values ??in a table. Once this data is obtained, Arduino calculates me an equation of the form ax ² + bx + c with which I can calculate the moisture in any seed.

The problem is as follows:

I do not know how to write a program to calculate an equation of the form ax ² + bx + c, I know Taylor's theorem facilitate my job, but I do not know at all how to write in C.

Can someone help me to transcribe the Taylor formula in C?

“An equation in the form ax2 + bx + c” is useless, unless you define what a, b, c, and x represent.

Solving a quadratic equation is trivial, when you know what to substitute for a, b, c, and/or x.

Which Arduino board do you have, or do you want to use ? Should the result be displayed on the serial monitor or on a LCD display ? Can you give a link to the sensor (just copy the url).

This is about Taylor theorem, https://en.wikipedia.org/wiki/Taylor%27s_theorem

Calculating with floating point numbers is not hard.

``````float result, x, a, b, c;
result = (a * (x * x)) + (b * x) + c;
``````

Do you want to get the polynomial regression from your set of values in form of

``````ax2 + bx + c
``````

or to interpolate the samples with a polynomial (ie. Taylor's polynomial)? http://en.wikipedia.org/wiki/Polynomial_regression http://en.wikipedia.org/wiki/Polynomial_interpolation http://en.wikipedia.org/wiki/Taylor_polynomial

What is wrong with the simple:-