### 12.14.6  Similarity in space: similarity

See section 11.15.6 for similarities in the plane.

The similarity command takes three or four arguments. The first argument is a line, the axis of rotation; the second argument is a real number, which is the scaling ratio, and the third argument is another real number, the angle of rotation. If the scaling ratio is negative, then the direction of rotation is reversed. The optional fourth argument is the object which is transformed.

With three arguments, similarity returns a new command which scales and rotated about the given axis.
Input:

s := similarity(line(point(0,0,0),point(1,1,1)), 2, 2*pi/3)

then:

s(point(0,0,1))

returns and draws the point (2,0,0), which is the point (0,0,1) rotated about the line through (0,0,0) and (1,1,1) through an angle of 2π/3 radians and scaled away from the line by a factor of 2.

With a fourth argument of a geometric object, similarity returns and draws the transformed object.
Input:

similarity(line(point(0,0,0),point(1,1,1)), 2, 2*pi/3, point(0,0,1))

returns and draws the point (2,0,0), as above.