aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/MatrixBase_homogeneous.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-09-02 10:47:40 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-09-02 10:47:40 +0200
commit305aa1f9c570db60a92e49020f21e70311bbed36 (patch)
treea7004eadb8c0f2a7a9456c7737e38a2b6e1711d3 /doc/snippets/MatrixBase_homogeneous.cpp
parenteb392960285c2645d45118d424786a73768ff50a (diff)
Add examples for hnormalized and homogenous (fix bug #846)
Diffstat (limited to 'doc/snippets/MatrixBase_homogeneous.cpp')
-rw-r--r--doc/snippets/MatrixBase_homogeneous.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/snippets/MatrixBase_homogeneous.cpp b/doc/snippets/MatrixBase_homogeneous.cpp
new file mode 100644
index 000000000..457c28f91
--- /dev/null
+++ b/doc/snippets/MatrixBase_homogeneous.cpp
@@ -0,0 +1,6 @@
+Vector3d v = Vector3d::Random(), w;
+Projective3d P(Matrix4d::Random());
+cout << "v = [" << v.transpose() << "]^T" << endl;
+cout << "h.homogeneous() = [" << v.homogeneous().transpose() << "]^T" << endl;
+cout << "(P * v.homogeneous()) = [" << (P * v.homogeneous()).transpose() << "]^T" << endl;
+cout << "(P * v.homogeneous()).hnormalized() = [" << (P * v.homogeneous()).eval().hnormalized().transpose() << "]^T" << endl; \ No newline at end of file