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

Same expressions shows different surfaces as is not same x interval defined. #386

Open
andrejuha opened this issue Sep 11, 2024 · 1 comment

Comments

@andrejuha
Copy link

image

@ChristopherChudzicki
Copy link
Owner

ChristopherChudzicki commented Sep 11, 2024

Same expressions shows different surfaces as is not same x interval defined.

It's important to understand that neither surface shown is really x*sin(1/x). Both are approximations. That will be true of any graphing tool, though some may approximate better than others.

The approximation is made by sampling (evaluating) the surface and connecting points with triangles.

By default, Math3d samples surfaces 64 times in the x direction and 64 times in the y direction (4096 samples total). You can change the number of samples with the gear icon (settings). More samples will degrade performance but yield a better approximation.

Math3d spaces the samples evenly over the plot range. With -10 to 10 that's every (20/64)th unit, and with -2 to 2 that's every (4/64)th unit.

Because the sames are taken at different points, the approximations are different.


All of this is to say: The behavior you see is not unusual, nor is it really a bug. It's just the nature of the tool you're using.

Which isn't to say sampling couldn't be handled better. Some tools, like Wolfram's Mathematica, sample more intelligently: samples are not evenly spaced, but spaced according to how fast the surface is changing. Flat surfaces need fewer samples.

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

No branches or pull requests

2 participants