We try to use this for understanding how cube status changes. You can dump/load operates or status to record for future use. Also it is compatible with the mobile phone to play.
Usage
mouse mode
left button point on backgroud to rotate scene
wheel to zoom in/out
right button point on backgroud to translate camera
left button point on cube piece and then mouse to another piece, release mouse to operate cube
touch mode
one figer point on backgroud to rotate scene
two figers point on backgroud to zoom in/out
two figers point on backgroud to translate scene
one figer point on cube piece and then mouse to another piece, release mouse to operate cube
Rubik's Cube Math Theory
(1) Cube Introduce
We define the piece is the unit piece on the cube surface. There are 3 types of piece: corner, edge, inner piece. We can see 3 colors on corner piece, 2 colors on edge piece and 1 color on inner piece. In n-order Rubik's Cube (n-cube), there are $n^3-(n-2)^3$ piece on cube. Among them are $8$ corner pieces, $12(n-2)$ edge pieces, and $6(n-2)^2$ inner pieces.
There are 6 faces in cube, as front, back, left, right, up, Down, which make the face collection${f, b, l, r, u, d}$. We use 6 different colors painted on each face, as Red, Orange, White, Yellow, Blue, Green, None, which make the color collection${R,O,W,Y,B,G,N}$. $N$ is the dummy part to describe no color. We assum that the cube observe this color mapping:
$$\begin {align}
&face \in \{f, b, l, r, u, d\}\\\
&color \in \{R, O, W, Y, B, G, N\} \\\
&face \rightarrow color \in
\{f \rightarrow R, b \rightarrow O, l \rightarrow W, r \rightarrow Y, u \rightarrow B, d \rightarrow G\}
\end {align}$$
(2) Piece Coordinate
We put the n-cube (n>=3) center to $(0, 0, 0)$ and assum that the cube side length as $1$. If n is even number, we use the center of each piece for coordinate; else use corner for coordinate. So that we can get the coordinate of each surface piece and they are all integers. The range of cooridinate is $[(n+1) \mod 2, \lfloor n/2 \rfloor]$. We use $(h, k, l)$ to represent the piece position.
We use $(h, k, l)$ to indicate postion, $(i, j, k)$ to indicate oritation, and $(c_1, c_2, c_3)$ to indicate color, which is correspond to oritation. One step rotate on piece is 90°. We define the anti-clock for positive direction and the piece operation $Fu(h, k, l)$ is as below.
In this equation, $T$ is the rotate transfor operation. As the piece surafce postion rotate equal to opposite axies rotate, so that the matrix on $(h, k, l)$ and $(i, j, k)$ are reverse.
If $(i, j, k)$ is not observe to right-hand corrdinate, before rotate, it should be applied mirror operation to right-hand; And after rotate, the sequence of $(i', j', k')$ shoud be permute to right-hand sequence. We use the equations below to adjust oritation rotate to right-hand coordinate. The permute is that sort the sequence of both oritation and color simultaneous to make oritation sequence to i, j, k.
The operation on cube is that rotate a plane 90° by an axis. The piece on this plane are rotating together. We use $G(t)$ to select the coordinate in axis $t$, and $F(t, l)$ to represents one operation on axis a and the plain coordinate on axis $t$ is $l$.
$$\begin{align}
&G(t) = \{c|c \in \{h, k, l\}, \text{c is on axis t} \}\ \\\
&F(t, l) = \prod Fu(h, k, l) \\\
&G(t) \equiv l
\end{align}$$
Here are some operation denote methods: a. RLUDFB Notation (Singmaster symbol)
<R|L|U|D|F|B>[reverse][times]
For example, RUR'URU2R' b. XYZ Notation
<X|Y|Z>(I, [times])
For example, X(2)X(-2)Y(2, 2)Y(2, -1)
Rubik's Cube Solve Method
todo
Rubik's Cube Pieces Example
These examples are about innercorner surface piece 3-cube
The corner piece: