Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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?

share|cite|improve this question
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

There is a limit test at a point x = a. So if lim f(x) = + or - infinity when x --> a, then you say x = a is a vertical asymptote.

share|cite|improve this answer
Yes, but is that possible to do with just a discreet set of points? – user1152717 Mar 16 '14 at 23:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.