So I'm trying to write a program to draw graphs that are entered by the user. The way I draw them is by finding y values at $x=a$ number of $x$ values across the graph and then connecting them by lines. However, some graphs (like $\tan(x)$) have asymptotes, so the bottom and top values are connected. Is there any mathematical way to detect whether there is a asymptote at a point or not?
Asked
Active
Viewed 435 times
2
-
You could try run the user input through some symbolic analysis program and get the "real" asymptotes, but for your program it will probably be better for you to apply some heuristic such as calling an asymptote anywhere you find the "derivative" ($\frac{\Delta y}{\Delta x}$) is larger than some threshold and the nearby values seem large. – Alfonso Fernandez Mar 16 '14 at 22:06
-
I guess that seems like a good idea – user1152717 Mar 16 '14 at 23:46
1 Answers
0
There is a limit test at a point $x=a$. So if $\lim_{x\to 0}f(x)=\pm\infty$, then you say $x=a$ is a vertical asymptote.
-
2Yes, but is that possible to do with just a discreet set of points? – user1152717 Mar 16 '14 at 23:45