Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to avoid vertical lines for undefined x-values? #54

Open
echteinfachtv opened this issue Nov 30, 2012 · 2 comments
Open

How to avoid vertical lines for undefined x-values? #54

echteinfachtv opened this issue Nov 30, 2012 · 2 comments

Comments

@echteinfachtv
Copy link

If you plot a graph, say (x+3)/(x-2) you have an undefined value at -2. This should not be drawn, however, we get a vertical line: http://www.gute-mathe-fragen.de/?qa=blob&qa_blobid=18172464407364120737

Another example, even worse: x+tan(x)
http://www.gute-mathe-fragen.de/?qa=blob&qa_blobid=8602167692544029133

This an important issue as users might think there is some value defined.

How can we solve that?

PS: I am ready to donate some money if that could be solved. As I said, that is a very important issue.

@aantthony
Copy link
Owner

I think the best way to solve this problem would be by avoiding parts of the domain where it becomes infinite. I think this would be equivalent to skipping the regions where 1/f(x) has a zero factor.

The other option is interval arithmetic, which could become very complicated, since this essentially means I will need to invent a new number type instead of simply dealing with the JavaScript Number type, or an OpenGL float type. This option would work, but might be difficult.

A third option would be to just skip the line segment if it jumps too quickly. I would do this by just making the line segment transparent between any two points which have a large jump.

And I don't need a donation at the moment, thanks.

@echteinfachtv
Copy link
Author

Maybe we should skip values in general that are higher than y=1000 and lower than y=-1000.

I remember writing a tangent program where I checked for the "jump" from tan(x), e. g. tan(x1) = 1000, tan(x2) = -1000, and did not draw that line.

I would be very glad if you implement this in the recent graph.tk → and if you do, how can I donate some beers to you?

Thanks,
Kai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants