コード例 #1
0
        public void Transpose()
        {
            Matrix33F m = new Matrix33F(rowMajor, MatrixOrder.RowMajor);

            m.Transpose();
            Matrix33F mt = new Matrix33F(rowMajor, MatrixOrder.ColumnMajor);

            Assert.AreEqual(mt, m);
            Matrix33F i = Matrix33F.Identity;

            i.Transpose();
            Assert.AreEqual(Matrix33F.Identity, i);
        }
コード例 #2
0
        /// <summary>
        /// Inverts the pose.
        /// </summary>
        public void Invert()
        {
            // Let
            //   R = Rotation as matrix
            //   t = translation as vector
            //   v = any vector
            //   v' = v transformed by the current pose
            //   Pose(v) = current pose
            //   Pose'(v) = inverse of current pose
            //
            // Pose(v) = Rv + t
            // v' = Rv + t
            // v' - t = Rv
            // R'(v' - t) = v
            // v = R'v' + R'(-t)
            // => Pose'(v) = R'v + R'(-t)

            // Calculate the inverse of the orientation.
            // (The inverse of an orthogonal is the same as the transposed matrix.)
            Orientation.Transpose(); // R'

            // Calculate the new translation
            Position = Orientation * -Position; // R'(-t)
        }
コード例 #3
0
ファイル: Matrix33FTest.cs プロジェクト: Zolniu/DigitalRune
 public void Transpose()
 {
     Matrix33F m = new Matrix33F(rowMajor, MatrixOrder.RowMajor);
       m.Transpose();
       Matrix33F mt = new Matrix33F(rowMajor, MatrixOrder.ColumnMajor);
       Assert.AreEqual(mt, m);
       Matrix33F i = Matrix33F.Identity;
       i.Transpose();
       Assert.AreEqual(Matrix33F.Identity, i);
 }