IsSquare
Tests if a two-dimensional container is square.
Syntax
-
IsSquare(X)
-
X
is any object
-
Description
IsSquare(X)
returns true
iff width(X) = height(X)
.
Examples
A ≔ ❨❨5, 1, 2❩, ❨4, 7, 5❩, ❨0, 2, 1❩❩
⎛5 1 2⎞ ⎜4 7 5⎟ ⎝0 2 1⎠
B ≔ ❨❨4, 7, 6❩❩
(4 7 6)
C ≔ ❨❨1❩, ❨2❩, ❨7❩❩
⎛1⎞ ⎜2⎟ ⎝7⎠
bm ≔ ComputePixmap(200, 200, x, y, rgb(x/199, y/199, 0.5))
A pixmap of size 200×200.
'(IsSquare(A), IsSquare(B), IsSquare(C), IsSquare(bm))
true false false true