0

Most answers to this question that I've seen just say that the program tests a function y=f(x) with the x values across the window and then connects the points produced by this. But what resolution of x values are tested?

Like when you enter the equation y = 1 / (x - 3.01) into desmos, it knows there is an asymptote at 3.01, but how? Surely this means the function must have been testing x values incrementing in at least 0.01, but testing at this scale would be far too slow to test all x values visible on the graph, especially when zooming out.

So then how does desmos identify an asymptote at 3.01?

James L
  • 63
  • 2
  • I'm not sure this answer can be answered authoritatively, since desmos is not open-source as far as I know. Finding vertical asymptotes numerically is not so bad unless your graph is quite nasty: if you have a region where you know there's at most one asymptote, you can bisect to find it. – Paul Hankin Feb 03 '21 at 15:03
  • Note that a modern CPU can do a lot of floating point operations per second. For example, an intel i7-8700k can do 8 billion floating point operations per second. So a LOT of points can be quickly tested to find an asymptote. – Paul Hankin Feb 03 '21 at 15:07
  • bisection and other search methods can be used for hardcoded functions however if your function is in text/string "expression" form you can use algebra calculus on it, compute derivation and obtain the ranges from there just like you would do it on paper... however you would need algebra engine and expression evaluation at your disposal. If you want just to detect asymptotes to correct drawing see [Rogue line being drawn to window](https://stackoverflow.com/a/41895485/2521214) – Spektre Feb 04 '21 at 08:08

0 Answers0