### 27.12.6 Similarity in space

See Section 26.14.6 for similarities in the plane.

The similarity command creates a command to rotate and scale about a given line.

- similarity takes three mandatory arguments and one optional argument:
  - L, a line (the axis of the rotation).
  - r, a real number (the scaling ratio).
  - θ, a real number (the angle of rotation).
  - Optionally, G, a geometric object.
- similarity(L,r,θ) returns a new command which rotates about L through an angle of θ and scales about L by a factor of r. If r is negative, the direction of rotation is reversed.
- similarity(L,r,θ,G) returns and draws the transformation of G.

#### Examples

S:=sphere([0,0,0],0.5); s:=similarity(line(point(0,1,0),point(0,1,1)), 2, 2*pi/3); color(S,blue),s(S)

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