invCube: Calculate Inverse Cube

Description Usage Arguments Details Value See Also Examples

Description

Calculates the inverse of a cube.

Usage

1
invCube(aCube, edges = TRUE, corners = TRUE)

Arguments

aCube

A cubieCube object.

edges

If FALSE, the inverse is not taken for the edges.

corners

If FALSE, the inverse is not taken for the corners.

Details

Every 3x3x3 cube A has a unique inverse cube A' where AA' and A'A are both equal to the solved state. The cube A does not need to be solvable. Larger cubes do not have unique inverses because larger cubes have indistinct pieces in the centres.

One use of the inverse is to enable the solver function to generate moves towards a target state that is not the solved state. For an initial cube A and a target state B the solver is applied to B'A. The moves of the solver then represent post-multiplication by A'B, which when applied to A gives AA'B which is equal to B, the target state. Only B'A needs to be solvable; both A and B could be unsolvable.

A solvable cube will always remain solvable after the function invCube is applied, even if edges or corners is FALSE. This is because the sign (even or odd) of a permutation is the same as the sign of the inverse permutation.

Value

A cubieCube object.

See Also

%v%, invMoves, is.solvable, solver

Examples

1
2
3
4
5
6
7
8
aCube <- getCubieCube("Tetris")
is.solved(aCube %v% invCube(aCube))
is.solved(invCube(aCube) %v% aCube)

## Not run: plot(aCube)
## Not run: plot(invCube(aCube))
## Not run: plot3D(aCube)
## Not run: plot3D(invCube(aCube))

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 
[1] TRUE
[1] TRUE

cubing documentation built on May 2, 2019, 10:16 a.m.