diff options
Diffstat (limited to 'eigen/unsupported/doc')
-rw-r--r-- | eigen/unsupported/doc/Overview.dox | 11 | ||||
-rw-r--r-- | eigen/unsupported/doc/examples/BVH_Example.cpp | 4 | ||||
-rw-r--r-- | eigen/unsupported/doc/examples/EulerAngles.cpp | 46 |
3 files changed, 54 insertions, 7 deletions
diff --git a/eigen/unsupported/doc/Overview.dox b/eigen/unsupported/doc/Overview.dox index d048377..45464a5 100644 --- a/eigen/unsupported/doc/Overview.dox +++ b/eigen/unsupported/doc/Overview.dox @@ -1,14 +1,15 @@ +/// \brief Namespace containing all symbols from the %Eigen library. namespace Eigen { -/** \mainpage Eigen's unsupported modules +/** \mainpage %Eigen's unsupported modules -This is the API documentation for Eigen's unsupported modules. +This is the API documentation for %Eigen's unsupported modules. These modules are contributions from various users. They are provided "as is", without any support. Click on the \e Modules tab at the top of this page to get a list of all unsupported modules. -Don't miss the <a href="..//index.html">official Eigen documentation</a>. +Don't miss the <a href="../index.html">official Eigen documentation</a>. */ @@ -18,8 +19,10 @@ Don't miss the <a href="..//index.html">official Eigen documentation</a>. The unsupported modules are contributions from various users. They are provided "as is", without any support. Nevertheless, some of them are -subject to be included in Eigen in the future. +subject to be included in %Eigen in the future. */ +/// \internal \brief Namespace containing low-level routines from the %Eigen library. +namespace internal {} } diff --git a/eigen/unsupported/doc/examples/BVH_Example.cpp b/eigen/unsupported/doc/examples/BVH_Example.cpp index 6b6fac0..afb0c94 100644 --- a/eigen/unsupported/doc/examples/BVH_Example.cpp +++ b/eigen/unsupported/doc/examples/BVH_Example.cpp @@ -6,9 +6,7 @@ using namespace Eigen; typedef AlignedBox<double, 2> Box2d; namespace Eigen { - namespace internal { - Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point - } + Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point } struct PointPointMinimizer //how to compute squared distances between points and rectangles diff --git a/eigen/unsupported/doc/examples/EulerAngles.cpp b/eigen/unsupported/doc/examples/EulerAngles.cpp new file mode 100644 index 0000000..3f8ca8c --- /dev/null +++ b/eigen/unsupported/doc/examples/EulerAngles.cpp @@ -0,0 +1,46 @@ +#include <unsupported/Eigen/EulerAngles> +#include <iostream> + +using namespace Eigen; + +int main() +{ + // A common Euler system by many armies around the world, + // where the first one is the azimuth(the angle from the north - + // the same angle that is show in compass) + // and the second one is elevation(the angle from the horizon) + // and the third one is roll(the angle between the horizontal body + // direction and the plane ground surface) + // Keep remembering we're using radian angles here! + typedef EulerSystem<-EULER_Z, EULER_Y, EULER_X> MyArmySystem; + typedef EulerAngles<double, MyArmySystem> MyArmyAngles; + + MyArmyAngles vehicleAngles( + 3.14/*PI*/ / 2, /* heading to east, notice that this angle is counter-clockwise */ + -0.3, /* going down from a mountain */ + 0.1); /* slightly rolled to the right */ + + // Some Euler angles representation that our plane use. + EulerAnglesZYZd planeAngles(0.78474, 0.5271, -0.513794); + + MyArmyAngles planeAnglesInMyArmyAngles(planeAngles); + + std::cout << "vehicle angles(MyArmy): " << vehicleAngles << std::endl; + std::cout << "plane angles(ZYZ): " << planeAngles << std::endl; + std::cout << "plane angles(MyArmy): " << planeAnglesInMyArmyAngles << std::endl; + + // Now lets rotate the plane a little bit + std::cout << "==========================================================\n"; + std::cout << "rotating plane now!\n"; + std::cout << "==========================================================\n"; + + Quaterniond planeRotated = AngleAxisd(-0.342, Vector3d::UnitY()) * planeAngles; + + planeAngles = planeRotated; + planeAnglesInMyArmyAngles = planeRotated; + + std::cout << "new plane angles(ZYZ): " << planeAngles << std::endl; + std::cout << "new plane angles(MyArmy): " << planeAnglesInMyArmyAngles << std::endl; + + return 0; +} |