Enum rlifesrc_lib::Transform
source · pub enum Transform {
Id,
Rotate90,
Rotate180,
Rotate270,
FlipRow,
FlipCol,
FlipDiag,
FlipAntidiag,
}
Expand description
Transformations (rotations and reflections) after the last generation in a period.
After the last generation in a period, the pattern will return to
the first generation, applying this transformation first,
and then the translation defined by dx
and dy
.
8 different values correspond to 8 elements of the dihedral group D8.
Id
is the identity transformation.
R
means rotations around the center of the world.
The number after it is the counterclockwise rotation angle in degrees.
F
means reflections (flips).
The symbol after it is the axis of reflection.
Some of the transformations are only valid when the world is square. and some are only valid when the world has no diagonal width.
Variants§
Id
Id
.
Identity transformation.
Rotate90
R90
.
90° rotation counterclockwise.
Requires the world to be square and have no diagonal width.
Rotate180
R180
.
180° rotation counterclockwise.
Rotate270
R270
.
270° rotation counterclockwise.
Requires the world to be square and have no diagonal width.
FlipRow
F-
.
Reflection across the middle row.
Requires the world to have no diagonal width.
FlipCol
F|
.
Reflection across the middle column.
Requires the world to have no diagonal width.
FlipDiag
F\
.
Reflection across the diagonal.
Requires the world to be square.
FlipAntidiag
F/
.
Reflection across the antidiagonal.
Requires the world to be square.
Implementations§
source§impl Transform
impl Transform
pub const ALL: [Self; 8] = _
sourcepub const fn require_square_world(self) -> bool
pub const fn require_square_world(self) -> bool
Whether this transformation requires the world to be square.
Returns true
for R90
, R270
, F\
and F/
.
sourcepub const fn require_no_diagonal_width(self) -> bool
pub const fn require_no_diagonal_width(self) -> bool
Whether this transformation requires the world to have no diagonal width.
Returns true
for R90
, R270
, F-
and F|
.