Contents Previous Next Subchapters

Rotating Plotting Axis
Syntax grotate(zyx)
See Also mesh

Description
Rotates the z, y, and x plotting axis by the specified number of degrees, where x, y, and z are integer, real, or double-precision scalars. Before the rotation, the positive x direction is to the right, the positive y direction is up, and the positive z direction comes out of the screen. (The direction of rotation is clockwise when looking down the corresponding axis from its positive side.)

Example
If you enter
     ginit
     v = seq(3)
     gplot(v, v, v)
     grotate(30, 0, 70)
     gxtitle("x")
     gytitle("y")
     gztitle("z")
The first rotation is 30 degrees about the positive z direction. This leaves the positive z direction fixed, makes the positive x direction down and to the right, and makes the positive y direction up and to the right.

The second rotation of 0 degrees about the positive y direction has no effect.

The third rotation of 70 degrees about the positive x direction (which is now down and to the right) leaves the positive z direction up and out of the screen, the positive y direction to the right, up, and into the screen, and the positive x direction as it was, down and to the right in the plane of the screen.