Previous Up Next

11.16.8  Check if an object in the plane is a square: is_square

See section 12.13.12 for checking for squares in three-dimensional geometry.

The is_square command is a Boolean function which takes as argument a geometric object or four points.

is_square returns 1 if the object (or quadrilateral determined by the four points) is a square and returns 0 otherwise.
Input:

is_square(1+i, -1+i, -1-i, 1-i)

Output:

1

Input:

K := square(1+i, -1+i)

then:

is_square(K)

Output:

1

Input:

K := square(1+i, -1+i, C, D); is_square(K[0])

Output:

1

Note that K[0] is a square since K is a list made of a square and vertices C and D. Entering affix(C,D) returns -1-i,1-i.
Input:

is_square(i, -1+i, -1-i, 1-i)

Output:

0

Previous Up Next