Graphing: Asymptote Detection
Ok, so far I have a little grapher. It graphs functions nicely, but a few things come up about handling certain functions. Let me give a couple of cases:
1) y=log(x)
I couldn't figure out how to stop getting an error for all x <= 0. So I just bypassed the error, but now it graphs a line y=0 for all x <= 0 when it shouldn't graph anything at all. So my question is how (I use vb6 btw, if that matters) can I bypass or determine and ignore the log of x, x <= 0? By the way, this really is log independant, its for any functions that have invalid values for certain x.
2) Asymptote Detection
y=1/x
Ok, so any function that has an asymptote will have it drawn when you connect the dots from the last iteration of the function to the current iteration. Just like on the old TI calculators. I have a poorly designed method, if the y value of the last iteration of the function has a different sign and its more than a certain number of pixels away from the current dot, then don't draw that line. Very crude method, and can cause problems later on, so is there a better way?
I can't think of any more at the moment, but this will give me a start. Thanks!
[Edited by - Anidem on February 12, 2006 8:19:28 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement