0
$\begingroup$

I'm currently creating a program to plot simple graphs in 2D. In order to draw those properly I have to know if a function graph is continuous between 2 points on the graph.

Assuming the graph for f(x)=tan(x) and two points on the graph P1(1,tan(1)) and P2(2,tan(2)). Is there an algorithmic way to tell if the graph is continuous for 1 <= x <= 2?

thanks

  • 1
    You might also want to look into implementing adaptive subdivision to ensure that glaring discontinuities are easily caught.2010-12-22

1 Answers 1

4

You can use interval arithmetic to compute reliable plots. See for instance this paper: Jeff Tupper, Reliable Two-Dimensional Graphing Methods for Mathematical Formulae with Two Free Variables, SIGGRAPH 2001. The excellent GrafEq software uses this technique.

  • 0
    Interval arithmetic is the "guaranteed correct" way of catching discontinuities in a plot; it's not (very) fast, but if the functions to be plotted are simple enough, it's very reliable.2010-12-22