14.8.1 Squares in space: square
See Section 13.9.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
- Input:
A:= point(0,0,0); |
B:= point(3,3,3); |
P:= point(0,0,3); |
square(A,B,P)
|
Output:
- Input:
A:= point(0,0,0); |
B:= point(3,3,3); |
P:= point(0,0,3); |
square(A,B,P,C,D) |
coordinates(C), coordinates(D)
|
Output:
⎡
⎢
⎢
⎣ | | , | | ,3 | √ | | +3 | ⎤
⎥
⎥
⎦ | , | ⎡
⎢
⎢
⎣ | − | | | √ | | ,− | | | √ | | ,3 | √ | | ⎤
⎥
⎥
⎦ |