I'm writing a program to sketch curves, be they simple single-valued
functions or implicit relations between variables (e.g., x^2/6 + y^2/9
= 1). One feature I'd especially like to include is the automatic
detection of vertical asymptotes. If my program knows which input
values are undefined, than it can avoid the ugly mistakes most
plotting programs make, like joining the two halves of the reciprocal
function across the y-axis. My original idea was to use Maxima, the
same CAS I use to split equations into functions and compute values
for each point, to find vertical asymptotes symbolically. It can't do
things like solve
limit f(x) = inf
x -> a-
for a, but it can invert the original function and then apply the
formula to find _horizontal_ asymptotes. I even got it to correctly
extrapolate missing asymptotes of partial inverses, i.e., give not
just -π/2 and π/2 for the tangent function but also every other that
would appear within the final graph. The trouble is that Maxima can't
invert all functions, not least because some functions aren't
invertible, like tan(x)/x. So, it seems to me that the only
sufficiently general solution is to use some kind of numerical
algorithm to detect asymptotes and approximate them as precisely as
necessary. But I don't know any such algorithm, and given my limited
knowledge of mathematics and nonexistent knowledge of computer
science, I'm afraid that any I'd design would be slow and incorrect.
Can anyone tell me of some preexisting one that works well?


|