diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-09-02 10:47:40 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-09-02 10:47:40 +0200 |
commit | 305aa1f9c570db60a92e49020f21e70311bbed36 (patch) | |
tree | a7004eadb8c0f2a7a9456c7737e38a2b6e1711d3 /doc/snippets/VectorwiseOp_homogeneous.cpp | |
parent | eb392960285c2645d45118d424786a73768ff50a (diff) |
Add examples for hnormalized and homogenous (fix bug #846)
Diffstat (limited to 'doc/snippets/VectorwiseOp_homogeneous.cpp')
-rw-r--r-- | doc/snippets/VectorwiseOp_homogeneous.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/snippets/VectorwiseOp_homogeneous.cpp b/doc/snippets/VectorwiseOp_homogeneous.cpp new file mode 100644 index 000000000..aba4fed0e --- /dev/null +++ b/doc/snippets/VectorwiseOp_homogeneous.cpp @@ -0,0 +1,7 @@ +typedef Matrix<double,3,Dynamic> Matrix3Xd; +Matrix3Xd M = Matrix3Xd::Random(3,5); +Projective3d P(Matrix4d::Random()); +cout << "The matrix M is:" << endl << M << endl << endl; +cout << "M.colwise().homogeneous():" << endl << M.colwise().homogeneous() << endl << endl; +cout << "P * M.colwise().homogeneous():" << endl << P * M.colwise().homogeneous() << endl << endl; +cout << "P * M.colwise().homogeneous().hnormalized(): " << endl << (P * M.colwise().homogeneous()).colwise().hnormalized() << endl << endl;
\ No newline at end of file |