Squares in space: square

### 13.8.1 Squares in space: square

See section 12.9.1 for squares in the plane.

The square command takes as arguments three points, A, B and P.

square returns and draws and returns the square with one side AB and the remaining sides in the same half-plane as P.
Input:

A := point(0,0,0); B := point(3,3,3);
P := point(0,0,3);

then:

square(A,B,P)

Output:

The square command also optionally takes two more arguments, variable names to assign to the two new vertices.
Input:

square(A,B,P,C,D)

then:

cooridinates(C); coordinates(D)

Output:

[-3*sqrt(2)/2+3,-3*sqrt(2)/2+3,3*sqrt(2)+3],
[-3*sqrt(2)/2,-3*sqrt(2)/2,3*sqrt(2)]