How to specify +/- in a function definition.
11-10-2017, 06:57 AM
Post: #1
 webmasterpdx Senior Member Posts: 541 Joined: Sep 2015
How to specify +/- in a function definition.
E.g. To plot a circle, you'd want to specify y=+/- sqrt(r^2 - x^2).
Normally a circle equation is specified as x^2+y^2=r^2, but the various apps insist we specify the functions as a function of x or y=f(x).

The same is in graph3d, where a sphere is x^2+y^2+z^2=r^2.
Again, specifying z=f(x,y) = +/- sqrt(r^2-(x^2+y^2))

In CAS, is there a way to specify a function as being plus or minus something as above?
Here I'm thinking from an analytical point of view, how does one specify +/- some function.

From an app plotting perspective, one thing I tried in function is to plot 2 functions, this time in graph3d, to plot a sphere:

F1 = sqrt(16-(x^2+y^2)) ............r = 4, r^2 = 16

F2 = -sqrt(16-(x^2+y^2))

Thus by plotting both functions, you should get the full function drawn.
From an analytical perspective, you could do the same thing perhaps, by specifying a vector of 2 elements representing both + and - the function respectively....as in [+f,-f].

Now, the problem I have with plotting both with graph3d is due to rounding errors you'll get jagged spaces around the midpoint of the sphere (the plane that splits it from +Z to -Z).

Is there a way to specify the sphere to do this right.
Note that at the moment I'm using the beta graph3d system software....but I'm sure the same problem exists in the public app.

I can't show this problem in the 2D case as the circle only has 2 points at the split point....since it's only a circle.

Here is a screenshot to show what I mean...

 « Next Oldest | Next Newest »

 Messages In This Thread How to specify +/- in a function definition. - webmasterpdx - 11-10-2017 06:57 AM RE: How to specify +/- in a function definition. - AlexFekken - 11-10-2017, 12:22 PM RE: How to specify +/- in a function definition. - Wes Loewer - 11-10-2017, 04:53 PM RE: How to specify +/- in a function definition. - webmasterpdx - 11-11-2017, 11:25 AM RE: How to specify +/- in a function definition. - Wes Loewer - 11-13-2017, 05:11 PM RE: How to specify +/- in a function definition. - AlexFekken - 11-11-2017, 11:43 AM RE: How to specify +/- in a function definition. - webmasterpdx - 11-11-2017, 12:15 PM RE: How to specify +/- in a function definition. - AlexFekken - 11-11-2017, 12:40 PM RE: How to specify +/- in a function definition. - AlexFekken - 11-11-2017, 12:22 PM RE: How to specify +/- in a function definition. - webmasterpdx - 11-11-2017, 01:22 PM RE: How to specify +/- in a function definition. - AlexFekken - 11-11-2017, 01:26 PM

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