彩色立方体魔方

I have made a half dozen blog posts aboutRubik's CubeSo far this year. And, during the MATLAB Central Mini Hack in October, I resurrected an old code about theColor CubeNow, a combination of the two, Rubik/Color Qube, creates an elegant tool for investigatingMatrices in the Action.

Contents

Opening

Here is the opening screen shot of Rubik/Color Qube, one of the most elaborate MATLAB designed that I have (written.

Rubik and Color

There are two modes,魔方color.in魔方模式,形成大型数据集来自27个一个小一模一样的复制品cubelet. The six cubelet faces have six company's colors, Red, white and blue are visible initially, Orange, yellow and green become visible as The faces are rotated.

The Incolor模式,大型数据集是由27cubelets,每一个都有不同的颜色。三个角落压制方糖的三原色是RGB颜色模型——红色,绿色和蓝色。三个角落是互补的青色,品红和黄色。白人和黑人的完整列表。

Color Qube

All of the familiar Rubik's moves are available incolorMode. Here is a screen shot after what rotations.

Rotations

Rotation matrices defined by thisFairly Rk功能使用的基本数学工具Qube. The animation provides a detailed look at The action produced by The F key, counter - clockwise rotation of The Front face. This is The y - axis, in case 2Fairly Rk. The detail is provided by takingd = 0:3:90, so there are 30 steps of 3 degrees.

函数R = Rk(轴,d)% fairly Rk (axis, d), Rotation by d degrees about the x, y, or z axis.C = cosd (d);S = sind (d);开关case1,R = [1 0 0 0 0 c s - s c];case2, R = [0 0 0 0 1 - s s c c];case3,R = [c s - s c 0 0 0 1);The endFmat = findobj ('tag','fmat');The if~ isempty (fmat) fmat. String = mat3 (R);The endThe end

n-by-n-by-n

QubeGeneralizes the classic 3 - by - 3 - by - 3 Rubik 's Cube to n - by - n - by - n cubes for any n.

2 - by - 2 - by - 2

The 2 - by - 2 - by - 2 cubes are good starting points for study of mathematical properties.

软件

Qube作为一个自解压可用MATLAB存档在这个链接,Qube_mzip. M.




Published with MATLAB ® R2022b

|

comments

To comment, please clickhereLog in to your MathWorks account or create a new account.