### 27.7.1 Squares in space

See Section 26.8.1 for squares in the plane.

The square command creates squares.

- square takes three mandatory arguments and two optional arguments:
  - A,B,P, three points.
  - Optionally, var1,var2, two variable names.
- square(A,B,P⟨,var1,var2⟩) returns and draws the square with one side AB and the remaining sides in the same half-plane as P.

  If the arguments var1 and var2 are given, they will be assigned to the new vertices.

#### Examples

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

A,B,P:=point(0,0,0),point(3,3,3),point(0,0,3); square(A,B,P,C,D); coordinates(C),coordinates(D)

⎡
⎢
⎢
⎣

−3

√

2

+6

2

,

−3

√

2

+6

2

,3

√

2

+3

⎤
⎥
⎥
⎦

,

⎡
⎢
⎢
⎣

−

3
2

√

2

,−

3
2

√

2

,3

√

2

⎤
⎥
⎥
⎦