### 11.15.6 Similarity in the plane: similarity

See section 12.14.6 for similarities in space.

The similarity command rotates and scales about a given point. It takes three or four arguments.

If similarity has three arguments, they are a point (the center of rotation), a real number (the scaling ratio) and a real number (the angle of rotation). similarity returns a new command which performs the transformation.
Input:

s := similarity(i, 2, -pi/2)

then:

s(1+i)

Output:

then:

s(circle(1+i,1))

Output:

If similarity has four arguments, the first three arguments are a point and two numbers as above, and the fourth argument is a geometric object. similarity returns and draws the transformed object.
Input:

similarity(i, 2, -pi/2, 1 + i)

Output:

Input:

similarity(i, 2, -pi/2, circle(1+i,1))

Output:

Note that for a point A and numbers k and a, the command similarity(A,k,a) is the same as homothety(A,k*exp(i*a)).