This page demonstrates some applets related to Java applications discussed in Chapter 8
of Computer Graphics for Java Programmers.
Section 8.1. A possibly hollow cylinder
Section 8.2. Platonic solids: dodecahedron
Section 8.2. Platonic solids: icosahedron
Section 8.3. Sphere representations
Section 8.5. Beams in a spiral
Section 8.6. Functions of two variables the variables x and y
numerical constants such as -0.1
functions cos, sin and pow (short for to the power)
the four binary operators + - * /
parentheses, as usual
In particular, do not use unary minus signs, other than for constants. For example, instead of
  -x * y / 5
Exercise 8.5. Two tori
n = number of vertices on each circle
D = diameter of outer circle
d = diameter of inner circle, or 0 is the cylinder is not hollow
The height of the cylinder is 1.
Check or change the values of n, D and d below and click on the OK button.
A sphere approximated by triangles
There will be n beams. Each next beam is turned alpha degrees compared with the previous one.
For each beam, height = width = 1, length (not less than 1) can be set below.
In the expression for z = f(x, y), you may use only
you should write either
  0 - x * y / 5   or simply   -0.2 * x * y 
as you can try by using copy and paste.
n = number of small circles on each torus
r = radius of center circle of each torus (at least 2)
Each small circle has radius 1.
Check or change the values of n and r below and click on the OK button.