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/DirectionWise_hnormalized.cpp | |
parent | eb392960285c2645d45118d424786a73768ff50a (diff) |
Add examples for hnormalized and homogenous (fix bug #846)
Diffstat (limited to 'doc/snippets/DirectionWise_hnormalized.cpp')
-rw-r--r-- | doc/snippets/DirectionWise_hnormalized.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/snippets/DirectionWise_hnormalized.cpp b/doc/snippets/DirectionWise_hnormalized.cpp new file mode 100644 index 000000000..3410790a8 --- /dev/null +++ b/doc/snippets/DirectionWise_hnormalized.cpp @@ -0,0 +1,7 @@ +typedef Matrix<double,4,Dynamic> Matrix4Xd; +Matrix4Xd M = Matrix4Xd::Random(4,5); +Projective3d P(Matrix4d::Random()); +cout << "The matrix M is:" << endl << M << endl << endl; +cout << "M.colwise().hnormalized():" << endl << M.colwise().hnormalized() << endl << endl; +cout << "P*M:" << endl << P*M << endl << endl; +cout << "(P*M).colwise().hnormalized():" << endl << (P*M).colwise().hnormalized() << endl << endl;
\ No newline at end of file |