Пример #1
0
        public void Orthogonalize()
        {
            Vector3d vector3d  = this.list_0[0];
            Vector3d vector3d2 = this.list_0[1] - Vector3d.Dot(this.list_0[1], vector3d) / (vector3d * vector3d) * vector3d;
            Vector3d value     = this.list_0[2] - Vector3d.Dot(this.list_0[2], vector3d) / (vector3d * vector3d) * vector3d - Vector3d.Dot(this.list_0[2], vector3d2) / (vector3d2 * vector3d2) * vector3d2;

            this.list_0[0] = vector3d;
            this.list_0[1] = vector3d2;
            this.list_0[2] = value;
        }
Пример #2
0
        public Matrix3d Orthonormalize()
        {
            Vector3d column    = this.GetColumn(0);
            Vector3d vector3d  = this.GetColumn(1) - Vector3d.Dot(this.GetColumn(1), column) / (column * column) * column;
            Vector3d vector3d2 = this.GetColumn(2) - Vector3d.Dot(this.GetColumn(2), column) / (column * column) * column - Vector3d.Dot(this.GetColumn(2), vector3d) / (vector3d * vector3d) * vector3d;
            Matrix3d matrix3d  = new Matrix3d();

            matrix3d.SetColumn(0, 1.0 / column.Norm * column);
            matrix3d.SetColumn(1, 1.0 / vector3d.Norm * vector3d);
            matrix3d.SetColumn(2, 1.0 / vector3d2.Norm * vector3d2);
            return(matrix3d);
        }