13.16.8 Checking if an object in the plane is a square: is_square
See Section 14.13.12 for checking for squares in
three-dimensional geometry.
The is_square command determines whether or not a
geometric object is a square.
-
is_square takes one argument:
G, a geometric object or a sequence of four points assumed to be
the vertices of a quadrilateral.
- is_square(G) returns 1 if the object
is a square and returns 0 otherwise.
Examples.
-
Input:
is_square(1+i, -1+i, -1-i, 1-i)
Output:
- Input:
K:= square(1+i, -1+i) |
is_square(K)
|
Output:
- Input:
K:= square(1+i, -1+i, C, D) |
is_square(K[0])
|
Output:
Note that K[0] is a square since K is a list made
of a square and vertices C and D.
Input:
affix(C,D)
Output:
- Input:
is_square(i, -1+i, -1-i, 1-i)
Output: