Diagonal+Mirroring

toc
 * Home * Chess * Position * Diagonal Mirroring**


 * Diagonal mirroring** mirrors all pieces along the main diagonal or main anti-diagonal. It is applicable in pawn-less endgames with castling no longer possible. Along with horizontal and/or vertical flipping, diagonal mirroring is used in pawn-less endgame tablebases to restrict a white king to the 10 squares of the a1-d4-d1 triangle of the board.

=Sample Position=
 * ~ Original ||~ ||~ Diagonal Mirror ||~ ||~ Anti-Diagonal ||
 * [[image:http://webchess.freehostia.com/diag/chessdiag.php?fen=k7/8/NK2B3/8/8/8/8/8%20w%20-%20-&size=small&coord=yes&cap=no&stm=yes&fb=no&theme=classic&color1=E3CEAA&color2=635147&color3=000000]] ||~ || [[image:http://webchess.freehostia.com/diag/chessdiag.php?fen=8/8/8/5B2/8/8/5K2/5N1k%20w%20-%20-&size=small&coord=yes&cap=no&stm=yes&fb=no&theme=classic&color1=E3CEAA&color2=635147&color3=000000]] ||~ || [[image:http://webchess.freehostia.com/diag/chessdiag.php?fen=k1N5/2K5/8/8/2B5/8/8/8%20w%20-%20-&size=small&coord=yes&cap=no&stm=yes&fb=no&theme=classic&color1=E3CEAA&color2=635147&color3=000000]] ||
 * k7/8/NK2B3/8/8/8/8/8 w - - ||~ || 8/8/8/5B2/8/8/5K2/5N1k w - - ||~ || k1N5/2K5/8/8/2B5/8/8/8 w - - ||

=Mirroring an 8x8 Board= An 8x8 Board with a rank-file mapping needs to swap rank and file. A pure 8x8 Board may be mirrored along the main diagonal that way in C: code format="cpp" int board[64], f, r, sm, sq, s;

for (f = 1; f < 8; ++f) for (r = 0; r < f; ++r) { sq = 8*r + f;  sm = 8*f + r;  s = board[sq]; board[sq] = board[sm]; board[sm] = s; } code

=See also=
 * Color Flipping
 * Flipping, Mirroring and Rotating of Bitboards
 * Horizontal Mirroring
 * Vertical Flipping

=External Links=
 * [|Mirror from Wikipedia]
 * [|Mirroring (psychology) from Wikipedia]
 * [|Reflection (mathematics) from Wikipedia]
 * [|Reflection (physics) from Wikipedia]
 * [|Reflection symmetry from Wikipedia]

=What links here?= include page="Diagonal Mirroring" component="backlinks" limit="40"
 * Up one Level**