1 (edited by kolobochka 2011-06-12 11:58:54)

Topic: Discontinuous function plotting

I have been doing a graphing program for a school project and I have a question about the plotting algorithm. How does it graph discontinuous functions correctly? For example, a function abs(sin(x))/sin(x) consists of parallel line segments (see attachments) which vertices are not connected. But most of graphing programs (like MathCAD and Wolfram Mathematica) connect the vertices (which is wrong) and Graph doesn't (which is right). That's why I ask how the plotting algorithm works that such functions are plotted correctly

Post's attachments

Attachment icon Graph - Right.bmp 11.46 kb, 520 downloads since 2011-06-11 

Wrong - Wolfram Alpha.gif, 2.31 kb, 299 x 133
Wrong - Wolfram Alpha.gif 2.31 kb, 474 downloads since 2011-06-11 

Re: Discontinuous function plotting

In short, when Graph detects that a function jumps, it will try to do more calculations in the area. If the two line segments do not get closer, Graph will not connect them.

Re: Discontinuous function plotting

Wow. Thats insane.

Re: Discontinuous function plotting

Thanks a lot for the help