as.standard {magic}R Documentation

Standard form for magic squares

Description

Transforms a magic square into Frenicle's standard form.

Usage

as.standard(m)
is.standard(m)

Arguments

m Magic square to be tested or transformed

Details

as.standard() transforms a magic square into Frenicle's standard form. The four numbers at each of the four corners are determined. First, the square is rotated so the smallest of the four is at the upper left. Then, element [1,2] is compared with element[2,1] and, if it is larger, the transpose is taken.

Thus all eight rotated and transposed versions of a magic square have the same standard form.

The square returned by magic() is in standard form.

is.standard() returns TRUE if the magic square is in standard form. This function checks for neither magicness nor normality (use is.magic and is.normal for this).

Author(s)

Robin K. S. Hankin

See Also

magic, eq

Examples

is.standard(magic.2np1(4))
as.standard(magic.4n(3))

[Package Contents]