2
$\begingroup$

Chart Example

I would like to be able to do something like this in c++.

How can I go about creating a nice curved line like this through a list of points?

Can anyone please point me in the direction of the relevant maths?

Edit 1:

Here is another example of what I would like from the output.

Graph 2

I need to be able to calculate Y for any given X...

Edit 2:

Please don't just post existing APIs, chances are they will be useless on an MCU. I would prefer reading the maths...

  • 3
    Look up "cubic spline"2012-09-12
  • 0
    In addition to cubic splines and splines in general, maybe these pointers can help as some are open source: http://stackoverflow.com/questions/481209/beautiful-charting-graphing-scientific-plotting2012-09-12
  • 0
    These may also be helpful: http://linux.about.com/od/howtos/l/blsc6.htm2012-09-12
  • 0
    I have been playing with them already... well bezier cubic splines... but its too complicated to work out the Y for any given X (which I need to do). Is there a version of cubic/quadratic splines which would allow me to do this?2012-09-12
  • 0
    What's an API? What's an MCU?2012-09-12

2 Answers 2