\code mat1.block(i,j,rows,cols)\endcode
\link MatrixBase::block(int,int,int,int) (more) \endlink |
\code mat1.block(i,j)\endcode
\link MatrixBase::block(int,int) (more) \endlink |
- the \c rows x \c cols sub-matrix starting from position (\c i,\c j) |
-
-\ref index "Overview"
- | \ref TutorialCore "Core features"
- | \b Geometry
- | \ref TutorialAdvancedLinearAlgebra "Advanced linear algebra"
-
-
-In this tutorial chapter we will shortly introduce the many possibilities offered by the \ref GeometryModule "geometry module",
-namely 2D and 3D rotations and affine transformations.
-
-\b Table \b of \b contents
- - \ref TutorialGeoRotations
- - \ref TutorialGeoTransformation
-
-\section TutorialGeoRotations 2D and 3D Rotations
-
-\subsection TutorialGeoRotationTypes Rotation types
-
-
-
-Rotation type | Typical initialization code | Recommended usage |
-2D rotation from an angle | \code
-Rotation2D rot2(angle_in_radian);\endcode | |
-2D rotation matrix | \code
-Matrix2f rotmat2 = Rotation2Df(angle_in_radian);\endcode | |
-3D rotation as an angle + axis | \code
-AngleAxis aa(angle_in_radian, Vector3f(ax,ay,az));\endcode | |
-3D rotation as a quaternion | \code
-Quaternion q = AngleAxis(angle_in_radian, axis);\endcode | |
-3D rotation matrix | \code
-Matrix3f rotmat3 = AngleAxis(angle_in_radian, axis);\endcode | |
-
-
-To transform more than a single vector the prefered representations are rotation matrices,
-for other usage Rotation2D and Quaternion are the representations of choice as they are
-more compact, fast and stable. AngleAxis are only useful to create other rotation objects.
-
-\subsection TutorialGeoCommonRotationAPI Common API across rotation types
-
-To some extent, Eigen's \ref GeometryModule "geometry module" allows you to write
-generic algorithms working on both 2D and 3D rotations of any of the five above types.
-The following operation are supported:
-
-Convertion from and to any types (of same space dimension) | \code
-RotType2 a = RotType1();\endcode |
-Concatenation of two rotations | \code
-rot3 = rot1 * rot2;\endcode |
-Apply the rotation to a vector | \code
-vec2 = rot1 * vec1;\endcode |
-Get the inverse rotation \n (not always the most effient choice) | \code
-rot2 = rot1.inverse();\endcode |
-Spherical interpolation \n (Rotation2D and Quaternion only) | \code
-rot3 = rot1.slerp(alpha,rot2);\endcode |
-
-
-\subsection TutorialGeoEulerAngles Euler angles
-
- | \b 3D | \b 2D |
-Creation \n rot2D can also be an angle in radian | \code
-Transform3f t;
-t.fromPositionOrientationScale(
- pos,any_3D_rotation,Vector3f(sx,sy,sz)); \endcode | \code
-Transform2f t;
-t.fromPositionOrientationScale(
- pos,any_2D_rotation,Vector2f(sx,sy)); \endcode |
-Apply the transformation to a \b point | \code
-Vector3f p1, p2;
-p2 = t * p1;\endcode | \code
-Vector2f p1, p2;
-p2 = t * p1;\endcode |
-Apply the transformation to a \b vector | \code
-Vector3f v1, v2;
-v2 = t.linear() * v1;\endcode | \code
-Vector2f v1, v2;
-v2 = t.linear() * v1;\endcode |
-Apply a \em general transformation \n to a \b normal \b vector
-(explanations) | \code
-Matrix{3,2}f normalMatrix = t.linear().inverse().transpose();
-n2 = (normalMatrix * n1).normalize();\endcode |
-Apply a transformation with \em pure \em rotation \n to a \b normal \b vector
-(no scaling, no shear) | \code
-n2 = t.linear() * n1;\endcode |
-Concatenate two transformations | \code
-t3 = t1 * t2;\endcode |
-OpenGL compatibility | \code
-glLoadMatrixf(t.data());\endcode | \code
-Transform3f aux(Transform3f::Identity);
-aux.linear().corner<2,2>(TopLeft) = t.linear();
-aux.translation().start<2>() = t.translation();
-glLoadMatrixf(aux.data());\endcode |
-\b Component \b accessors |
-full read-write access to the internal matrix | \code
-t.matrix() = mat4x4;
-mat4x4 = t.matrix();
-\endcode | \code
-t.matrix() = mat3x3;
-mat3x3 = t.matrix();
-\endcode |
-coefficient accessors | \code
-t(i,j) = scalar; <=> t.matrix()(i,j) = scalar;
-scalar = t(i,j); <=> scalar = t.matrix()(i,j);
-\endcode |
-translation part | \code
-t.translation() = vec3;
-vec3 = t.translation();
-\endcode | \code
-t.translation() = vec2;
-vec2 = t.translation();
-\endcode |
-linear part | \code
-t.linear() = mat3x3;
-mat3x3 = t.linear();
-\endcode | \code
-t.linear() = mat2x2;
-mat2x2 = t.linear();
-\endcode |
-
-
-\b Transformation \b creation \n
-Eigen's geometry module offer two different ways to build and update transformation objects.
-
- | \b procedurale \b API | \b natural \b API |
-Translation | \code
-t.translate(Vector_(tx, ty, ...));
-
-t.pretranslate(Vector_(tx, ty, ...));
-\endcode | \code
-t *= Translation_(tx, ty, ...);
-t2 = t1 * Translation_(vec);
-t = Translation_(tx, ty, ...) * t;
-\endcode |
-Rotation \n In 2D, any_rotation can also \n be an angle in radian | \code
-t.rotate(any_rotation);
-
-t.prerotate(any_rotation);
-\endcode | \code
-t *= any_rotation;
-t2 = t1 * any_rotation;
-t = any_rotation * t;
-\endcode |
-Scaling | \code
-t.scale(Vector_(sx, sy, ...));
-
-t.scale(s);
-t.prescale(Vector_(sx, sy, ...));
-t.prescale(s);
-\endcode | \code
-t *= Scaling_(sx, sy, ...);
-t2 = t1 * Scaling_(vec);
-t *= Scaling_(s);
-t = Scaling_(sx, sy, ...) * t;
-t = Scaling_(s) * t;
-\endcode |
-Shear transformation \n ( \b 2D \b only ! ) | \code
-t.shear(sx,sy);
-t.preshear(sx,sy);
-\endcode | |
-
-
-Note that in both API, any many transformations can be concatenated in a single expression as shown in the two following equivalent examples:
-
Transformation type | Typical initialization code |
-2D rotation from an angle | \code
+\ref Rotation2D "2D rotation" from an angle | \code
Rotation2D rot2(angle_in_radian);\endcode |
-3D rotation as an angle + axis | \code
+3D rotation as an \ref AngleAxis "angle + axis" | \code
AngleAxis aa(angle_in_radian, Vector3f(ax,ay,az));\endcode |
-3D rotation as a quaternion | \code
+3D rotation as a \ref Quaternion "quaternion" | \code
Quaternion q = AngleAxis(angle_in_radian, axis);\endcode |
N-D Scaling | \code
diff --git a/doc/eigendoxy.css b/doc/eigendoxy.css
index 1e20503c5..cd7e97868 100644
--- a/doc/eigendoxy.css
+++ b/doc/eigendoxy.css
@@ -461,6 +461,23 @@ DIV.navigation {
padding-top : 5px;
}
+img {
+ border: 0;
+}
+table {
+ border-collapse: collapse;
+ border-style: none;
+ font-size: 1em;
+}
+th {
+ text-align: left;
+ padding-right: 1em;
+/* border: #cccccc dashed; */
+/* border-style: dashed; */
+/* border-width: 0 0 3px 0; */
+}
+
+
TABLE.noborder {
border-bottom-style : none;
border-left-style : none;
@@ -480,22 +497,18 @@ TABLE.noborder TD {
vertical-align: top;
}
-TABLE.tutorial_code {
- border-bottom-style : none;
- border-left-style : dashed;
- border-right-style : dashed;
- border-top-style : dashed ;
- border-spacing : 0px 0px;
+table.tutorial_code {
+ border-collapse: collapse;
empty-cells : show;
margin: 4pt 0 0 0;
padding: 0 0 0 0;
}
-TABLE.tutorial_code TD {
- border-bottom-style : dashed;
- border-left-style : none;
- border-right-style : none;
- border-top-style : none;
- border-spacing : 0px 0px;
+table.tutorial_code tr {
+ border-style: none dashed none dashed;
+ border-width: 1px;
+}
+table.tutorial_code td {
+ border-style: dashed none dashed none;
empty-cells : show;
margin: 0 0 0 0;
padding: 2pt 5pt 2pt 5pt;
|