/** * Block matrices are used to represent faces with more than four * sides. Each corner section is stored as a normal matrix, followed * by rows of middle values, and a center value if necessary. * * To help visualize block matrices, see the following representation * of a teraminx, https://www.desmos.com/geometry/qxudy50gag * * [ * [ * ['a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8'], // <- five 3x3 matrices * ['b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8'], * ['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8'], * ['d0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8'], * ['e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8'], * ], * [ * ['f0', 'f1', 'f2'], // <- five 3x1 matrices * ['g0', 'g1', 'g2'], * ['h0', 'h1', 'h2'], * ['i0', 'i1', 'i2'], * ['j0', 'j1', 'j2'], * ], * 'center', // <- one middle * ] */ export type BlockLayer = [T[], T | undefined, T[]]; export type BlockMatrix = [T[][]] | [T[][], (T | undefined)[][], T]; export type BlockMatrixObj = { index: number; matrix: number; }; /** * Create a block matrix. * * @param {number} polygon number of polygon sides, must be >= 5 * @param {number} depth size of block matrix. kilominx would be 2, megaminx would be 3, etc... * @param {Function} fn function to set initial values */ export declare function createBlockMatrix(polygon: number, depth: number, fn: (obj: BlockMatrixObj) => T): BlockMatrix; /** * Extract layer from block matrix. * * @param {BlockMatrix} block * @param {number} angle * @param {number} depth */ export declare function extractBlockLayer(block: BlockMatrix, angle: number, depth: number): BlockLayer; /** * Inject layer to block matrix. * * @param {BlockMatrix} block * @param {BlockLayer} layer * @param {number} angle * @param {number} depth */ export declare function injectBlockLayer(block: BlockMatrix, layer: BlockLayer, angle: number, depth: number): BlockMatrix; /** * Iterate over all members of a block matrix. */ export declare function iterateBlockMatrix(block: BlockMatrix, fn: (val: T) => void): void; /** * Rotate a block matrix. * * @param {BlockMatrix} block * @param {number} rotation */ export declare function rotateBlockMatrix(block: BlockMatrix, rotation: number): BlockMatrix;