我必须使用变换矩阵来动画变换:元素的比例.
我想从0扩展到1.如果我使用以下代码它可以正常工作:
.container {
    width: 200px;
    height: 100px;
    background: yellow;
    transform: scale(0);
    transition: transform 1s;
}
.container.open {
    transform: scale(1);
}
https://jsfiddle.net/w4kuth78/1/
如果我用的是矩阵本身,它是不工作的.
.container {
    width: 200px;
    height: 100px;
    background: yellow;
    transform: matrix(0, 0, 0, 0, 0, 0);
    transition: transform 1s;
}
.container.open {
    transform: matrix(1, 0, 0, 1, 0, 0);
}
https://jsfiddle.net/m7qpetkh/1/
我做错了什么或者这不起作用?我想知道,因为它在Chrome和Firefox中不起作用......
console_log调试输出表示在从0到1的缩放时,矩阵也从矩阵(0,0,0,0,0,0)到矩阵(1,0,0,1,0,0)设置.
编辑:
完全混淆......如果我将矩阵中的scaleX和scaleY值更改为0.1或0.01,它就可以工作......哇
css scaletransform css-transitions css-transforms matrix-transform
假设我定义了一个矩阵并按以下方式分配值:
 double A[row * column];
 for (int j = 0; j < column; j++){
     for (int i = 0; i < row; i++){
       A[j*row + i] = ((double)rand())/RAND_MAX; // random value
     }
   }
如何计算这个矩阵的转置?我尝试了以下操作,但结果矩阵不正确。
double B[column * row]; 
for(int j = 0; j < row; j++){
     for(int i = 0; i < column; i++){
       B[j*row + i] = A[i*row + j];
     }
   }