x =

y =

z =

In this demo, a translucent cube rotates about an axis. The axis of rotation is shown as a long white arrow. The arrow passes through the point (0,0,0) and points in the direction of the point (x,y,z), where the values of x, y, and z come from the input boxes at the right. (The rotation animation is turned off initially. It can be turned on and off using the checkbox, and it comes on automatically whenever the axis is changed.)

A set of coordinate axes is also shown. The positive x-axis is a green arrow, the positive y-axis is blue, and the positive z-axis is red. One of the coordinate axes might be hidden by the axis of rotation. (Initially, the y-axis is hidden.)

You can drag your mouse to rotate the whole assembly, to get a better view. Try rotating the view so that the axis of rotation is pointing straight towards you, and notice that the direction of rotation is counterclockwise from that point of view. You should observe that the direction of rotation always follows the "right-hand rule": If you point your right thumb along the rotation axis, then the fingers of your right hand will curl in the direction of rotation. The right-hand rule applies because the coordinate system for the demo is a right-handed coordinate system.

The "Set" button takes values from the input boxes and uses them to set the point (x,y,z) that determines the axis of rotation. For example, try choosing (x,y,z) to make the cube rotate around one of its major diagonals.

The "Reset" button restores the demo to its initial state (but with the animation turned on).

The "+X" button sets the axis of rotation to point in the direction of the positive x-axis; it sets (x,y,z) = (1,0,0). The "-X" button makes the axis point in the direction of the negative x-axis, with (x,y,z) = (-1,0,0). The "+Y", "-Y", "+Z", and "-Z" buttons so that same things for the y- and z-axes. The coordinate axes are the most common choices for the rotation axis.