5
$\begingroup$

How are graphs plotted or sketched?

If you have a graph plotting software for example mathematica or matlab, or you want to see what the graph of $e^{2x}$ looks like, how do you plot/sketch such a graph?

If you proceed by using a finite number of points, and "extrapolating" and "interpolating", then how do you know that that method is reliable? There are infinitely many smooth(or non-smooth) graphs that can be drawn through a finite number of points.

  • 0
    This is $n$ot $a$ simple question. Even advanced plotting software like mathematica has its issues with some nasty oscillating function graphs so there is no method yet that always works. However if your function is smooth enough you can make a reasona$b$le interpolation with polynoms and use this to draw the function.2011-01-21

1 Answers 1

1

Basically (keyword: "basically"), it works like this:

BEGIN     DECLARE x     SET x TO x1     WHILE x IS LESS THAN TO x2         DRAW LINE BETWEEN f(x) and f(x-step)   // "linear interpolation"         INCREASE x BY step     END WHILE END 

Where step is some small number... Something like 0.01, depending on how fast you want it. $step = \lim_{x\to 0^+}$ would be "perfectly smooth", but we don't have the resources for such measures, so we're stuck with anything between $10^{50}$ and $10^{-50}$.

They won't be "infinitely smooth". That would require infinite amounts of RAM and CPU. It only has to "look" smooth. It's only limited by your RAM/CPU, time (unless you feel like waiting a few trillion years), and most importantly, your screen resolution.

More complex plotters can determine the vertical asymptotes, but I don't need to get into that.

  • 0
    See Ryan's comment above - a good graphing package will attempt to heuristically estimate the modulus of continuity. This is not possible (non-recursive) in the black-box model, but if the function is given explicitly enough, then by bounding the derivative you can bound the modulus of continuity and so draw a meaningful graph.2011-01-21