Post Reply 
Public Beta Availiable - Win/Mac/Firmware [UPDATED]
11-11-2017, 04:33 PM (This post was last modified: 11-11-2017 11:11 PM by Anders.)
Post: #86
RE: Public Beta Availiable - Win/Mac/Firmware [UPDATED]
(11-11-2017 12:26 PM)webmasterpdx Wrote:  Possible bugs in graph3d.

First, the Autoscale zoom option seems to always give the ! reply.

Second....

If you try to plot a half a sphere using:

FZ1=sqrt(16-(X^2+Y^2))

This should be a sphere of radius 4. You'll notice these extreme jaggies as it gets close to the plane z=0. At first, I thought it might just be rounding errors, but if you use a radius of 10, you can see the blank areas are much taller in the z direction than 1, which means it's not rounding error. It should be flush with the plane z=0.

Try plotting the following:

FZ1=sqrt(16-(X^2+Y^2))

FZ2=0

That'll plot the semi-sphere and the plane, which gives the following (the semi-sphere should be flush with the plane)...

confirmed. I get the same.
If you add FZ2=-sqrt(16-(X^2+Y^2)) you should get a complete sphere (two halvs each in a different color) and you see the error more clearly.

e.g. approaching the Y=-4 plan the sphere shows a "perfect" circular hole with radius approximately = 1.2 "ish".
The app is drawing lots circles at increasing/decreasing diameters to create the 3D object. you can clearly see the beginning of several circles centered around the Z=0 plane from both x and the y direction.


It also does not matter if you change the Num X Step and NUM Y Step to something smaller say 0.0000001 because that is in the Graph 3D Num Set Up screens. Nor does it change if you use the x^0.5 function instead => it is in the app not in the sqrt function

I think what happens is that the 16-(X^2+Y^2) eventually becomes negative as the algorithm increases X and Y with a step dx,dy so when the next X=X+dx and next Y=Y+dy evaluated: Z(X+dx,Y+dy) fails, (because sqrt(negative value)) the plot functions simply terminates. What the plot function should do, is use smaller and smaller steps to keep 16-(X^2+Y^2) >=0 until no hole is no longer visible and then terminate.

Conclusion:

The Plot X and Y Steps are simply too large drawing each circle or point creating holes in the Z plane.
Since the Graph 3D Num Set Up step values have no effect the Plot step, maybe you (HP) need to add Plot X Step and Plot Y Step parameters on one of the Graph 3D Plot Set Up screens so the user have more control.

Alternatively (as an option introduce a tick mark on one of the Graph 3D Plot Set Up screens) automate plot step adaptively:
If the delta between two plot points: Z(x+dx,y+dy) - Z(x,y) is > smallest visible "hole" or if Z(x+dx,y+dy) leads to an error (in the case of sqrt() above), given the scale parameters, then half the step (dx and dy) in each direction x,y (independently based on your plot algorithm) and evaluate again. Repeat until Z(x+dx,y+dy) - Z(x,y) < smallest visible "hole" size (However, not beyond an allowed Min step size to avoid local singularities when Z-> infinity and get to termination). When true, plot Z(x+dx,y+dy) (again: you need to evaluate Z-deltas in the x and y direction independently as we are not always going to have a symmetric body). Similarly, to speed up the algorithm, you need to adaptively increase the step size if the Z(x+dx,y+dy) - Z(x,y) starts to get to small too small to show on the plot... (say as Z approaches 4 and -4 in the this example). However, not beyond a max step size (again to limit the risk of jumping over local singularities or anomalies).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Public Beta Availiable - Win/Mac/Firmware [UPDATED] - Anders - 11-11-2017 04:33 PM



User(s) browsing this thread: 1 Guest(s)