6.3 Standard Functions of two variables z = f(x,y)

For the illustration of surfaces in space z = f(x,y) the simulation is particularly useful. Because of the amount of accumulated data, a numerical calculation of the graphs by hand is virtually impossible. In addition the EJS method makes it possible to rotate the calculated two-dimensional projections of three-dimensional surfaces around any spatial axis by simply dragging the mouse to create a lively three-dimensional impression. If in addition another parameter, for example the extent along z-axis, is changed periodically (i.e. z = acos(pt) f(x,y)), one experiences something close to seeing three-dimensional objects.

The command panel of Fig.6.4 contains four sliders for changing continuously adjustable parameters. The parameter p determines in general the velocity of animation. With the Play button one starts the animation and it is halted with the Stop button; the small text field shows the time. Reset returns all parameters to their original values.

In the selection field a preset function type can be chosen, whose formula is shown in the formula field below. The term cos(t) determines the animation in z-direction. You can edit these formulas or enter new ones from scratch ( you must not forget to press Enter to confirm changes!). Fig.6.4 shows a hyperbolic saddle as example.

In the following interactive figures showing an example of the 3D function plotter the simulation controls have been suppressed, which correspond to those of Fig.6.4.

For the plots the x - y-plane z = 0 (light brown) was superimposed on the respective spatial surfaces, The origin is in them middle of this surface. The x - y-plane can be switched on or off with the option box show x-y plane. The scales on the axes are all equal and symmetric. You can create different scales via factors in the formulas. The coloured points on z-axis mark the minimum and maximum values of the presentation.

z = f(x,y) only allows for parts of a closed surfaces in space, as for example the sphere that is shown here, to be plotted (for example half a sphere). This corresponds to the statement that in the plane a function y = f(x) can only represent half a circle. To describe the full circle y1 = r2 - x2;y2 = -r2 - x2 one requires two functions in this representation. If the functions do not yield real values for z, z = 0 is shown in the simulations.

You may chose from the functions defined in the table below . The list of the formulas also gives the syntax that must be adhered to also when editing.


plane in space

paraboloid of revolution

general paraboloid

parabolic saddle


ellipsoid of revolution

general ellipsoid

hyperboloid of revolution

s general hyperboloid

elliptic hyperbolic saddle

hyperbolic Saddle

standing wave

radial surface wave

(decay like 1r))

formula in Java-syntax of the simulation

cos(p*t)*((b*x) + (a*y)) – c

a*cos(p*t)*(xˆ2 + yˆ2) – c

cos(p*t)*((b*x)ˆ2 + (a*y)ˆ2) – c

cos(p*t)*((b*x)ˆ2 - (a*y)ˆ2) – c

sqrt((a)ˆ2*abs(cos(p*t)) - xˆ2 - yˆ2)

sqrt((b*c)ˆ2*abs(cos(p*t)) -((c+1)*x)ˆ2 - (c*y)ˆ2)

sqrt(a*b - b*xˆ2 - a*yˆ2)

sqrt(a*cos(p*t)ˆ2 + xˆ2 + yˆ2)-c

sqrt(aˆ2 + b*xˆ2 + c*yˆ2)-p

sqrt(aˆ2 - cos(p*t)*(b*xˆ2 - c*yˆ2))




You can use this file to train your spatial sense and to study the meaning of specific equations, at the same time having ample leeway to come up with your own formulas. You may also study the influence of the signs and the powers appearing in the formulas. If the uniform scaling used proves inconvenient, for example when dividing by 0, you may adjust the scaling in the formulas accordingly with additive or multiplicative constants in the formulas.

Further instructions can be found in the description pages of the simulation.

Figure 6.4: Function plotter for animated spatial surfaces z = f(x,y); In the figure a hyperbolic saddle is shown. Up to 3 parameters a,b,c can be adjusted with sliders. The animation velocity is adjusted with the slider p. The xy-plane can be shown or suppressed.

The 3D projection of EJS offers in the active simulation many possibilities of the optical representation. We shows this in the following non-interactive static pictures for the example of elliptic-hyperbolic saddle.

Figure 6.5: Choice of different viewing directions for perspective distortion, shown for a hyperbolic-elliptic saddle of the simulation inf Fig.6.4. Turning the object is effected via pulling the arrow inside of the spatial trihedron with the mouse. With the perspective representation t the lines that lay further away pictured smaller than equally long lines that are closer by.

Default picture: when calling up the simulation you see as in Fig.6.4 the projection of the spatial surface with a xyz-trihedron in a preset perspective, with the lines that lay further away being pictured smaller than those, that are closer by.

Rotation: With the mouse one can dock on to any of the axes and rotate the projection at will.

Shifting: When pressing the Ctrl-key you can move the representation of the projection surface with the mouse and position it as desired.

Zoom: When pressing the shift-key you may blow up or shrink the representation by pulling with the mouse. You also may switch or pull the root window to full screen size.

Further special perspectives are obtained with a context menu that appears when pressing the right mouse button on the plot. In the upper line you follow the entries elements option/drawingPanel3D/Camera and the following Camera Inspector appears (see Fig.6.6).

Figure 6.6: Camera inspector, which is called with the right mouse key from the context menu. One can choose between different perspectives and projections, enter the parameters of a special projection as numbers and return with Reset to the original state

Figure 6.7: Presentation without perspective distortion

You may chose the following options with the projector:

No perspective: The presentation now does not show perspective distortion for the same projection (Fig.6.7).

On the xy, yz or xz-plane. Here you see the projection align an axis, namely the one that is not mentioned (Fig.6.8).

For the different representations the optimal visualization depends on the parameters used, that have to be changed when adjusting the representation.

Reset Camera resets the Camera inspector to a simple perspective. This is useful if you have created a perspective, that is too confusing. Alternatively you may switch to another function and then back and recalculate the plot with the original parameters.

Figure 6.8: Projections along the three axes