矩阵的运算 Matrix Operations

Transpose 转置

矩阵 的转置通常被记为: 。获取转置的过程可以有很多种描述,比较常见的解释是,将矩阵的行作为矩阵的列,即 中的行作为 中的列, 中的列,作为 中的行。C++代码的描述为:

Matrix44 transpose() const {
  Matrix44 transpMat;
  for (uint8_t i = 0; i< 4; i++) {
    for (uint8_t j = 0; j< 4; j++) {
      transpMat[i][j] = m[j][i];
    }
  }
  return transpMat;
}

转置矩阵主要用于3D应用中,行主序和列主序间的转换。

Inverse 逆

数学领域,矩阵的逆通常写为:

。公式为:

I表示 单位矩阵(identity matrix)。矩阵乘以它的逆得到单位矩阵。

矩阵的逆同样用于3D应用中。

results matching ""

    No results matching ""