I want to approximate a known, continuous function $f(x)$ within in a given interval $[a, b]$ by linear segments, defined by their start/end points. The amount $N$ of points is given, but they don't have to be equidistant (otherwise, this problem would be trivial).
I assume this is a pretty common problem, but I can't find much about it online. Is there any common algorithm for this?
Here is a quick example sketch of what I mean, with $N = 14$.
