Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 99cb5ede6a5329071fbeecc8218deb35 > files > 1090

eigen3-doc-3.2-3.mga4.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Eigen: Space transformations</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css"   rel="stylesheet" type="text/css" />
<link href="eigendoxy.css" rel="stylesheet" type="text/css">
<!--  -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
<!-- <script type="text/javascript"> -->
<!-- </script> -->
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- <a name="top"></a> -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Eigen_Silly_Professor_64x64.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname"><a href="http://eigen.tuxfamily.org">Eigen</a>
   &#160;<span id="projectnumber">3.2.0</span>
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__TutorialGeometry.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Space transformations<div class="ingroups"><a class="el" href="group__Geometry__chapter.html">Geometry</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>In this page, we will introduce the many possibilities offered by the <a class="el" href="group__Geometry__Module.html">geometry module</a> to deal with 2D and 3D rotations and projective or affine transformations.</p>
<p><a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a>'s Geometry module provides two different kinds of geometric transformations:</p>
<ul>
<li>Abstract transformations, such as rotations (represented by <a class="el" href="classEigen_1_1AngleAxis.html">angle and axis</a> or by a <a class="el" href="classEigen_1_1Quaternion.html">quaternion</a>), <a class="el" href="classEigen_1_1Translation.html">translations</a>, <a class="el" href="classScaling.html">scalings</a>. These transformations are NOT represented as matrices, but you can nevertheless mix them with matrices and vectors in expressions, and convert them to matrices if you wish.</li>
<li>Projective or affine transformation matrices: see the <a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a> class. These are really matrices.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>If you are working with OpenGL 4x4 matrices then Affine3f and Affine3d are what you want. Since <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> defaults to column-major storage, you can directly use the <a class="el" href="classEigen_1_1Transform.html#a4663159a1450fa89214b1ab71f7ef5bf">Transform::data()</a> method to pass your transformation matrix to OpenGL.</dd></dl>
<p>You can construct a <a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a> from an abstract transformation, like this: </p>
<div class="fragment"><div class="line">Transform t(AngleAxis(angle,axis));</div>
</div><!-- fragment --><p> or like this: </p>
<div class="fragment"><div class="line">Transform t;</div>
<div class="line">t = AngleAxis(angle,axis);</div>
</div><!-- fragment --><p> But note that unfortunately, because of how C++ works, you can <b>not</b> do this: </p>
<div class="fragment"><div class="line">Transform t = AngleAxis(angle,axis);</div>
</div><!-- fragment --><p> <span class="note"><b>Explanation:</b> In the C++ language, this would require <a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a> to have a non-explicit conversion constructor from <a class="el" href="classEigen_1_1AngleAxis.html" title="Represents a 3D rotation as a rotation angle around an arbitrary 3D axis. ">AngleAxis</a>, but we really don't want to allow implicit casting here. </span></p>
<h1><a class="anchor" id="TutorialGeoElementaryTransformations"></a>
Transformation types</h1>
<table  class="manual">
<tr>
<th>Transformation type</th><th>Typical initialization code </th></tr>
<tr>
<td><a class="el" href="classEigen_1_1Rotation2D.html">2D rotation</a> from an angle</td><td><div class="fragment"><div class="line">Rotation2D&lt;float&gt; rot2(angle_in_radian);</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>3D rotation as an <a class="el" href="classEigen_1_1AngleAxis.html">angle + axis</a></td><td><div class="fragment"><div class="line">AngleAxis&lt;float&gt; aa(angle_in_radian, <a class="code" href="group__matrixtypedefs.html#ga5ac9fb0df0c4858477890cce1f998096">Vector3f</a>(ax,ay,az));</div>
</div><!-- fragment --> <span class="note">The axis vector must be normalized.</span> </td></tr>
<tr>
<td>3D rotation as a <a class="el" href="classEigen_1_1Quaternion.html">quaternion</a></td><td><div class="fragment"><div class="line">Quaternion&lt;float&gt; q;  q = AngleAxis&lt;float&gt;(angle_in_radian, axis);</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>N-D <a class="el" href="classScaling.html" title="Represents a generic uniform scaling transformation. ">Scaling</a></td><td><div class="fragment"><div class="line"><a class="code" href="classScaling.html">Scaling</a>(sx, sy)</div>
<div class="line"><a class="code" href="classScaling.html">Scaling</a>(sx, sy, sz)</div>
<div class="line"><a class="code" href="classScaling.html">Scaling</a>(s)</div>
<div class="line"><a class="code" href="classScaling.html">Scaling</a>(vecN)</div>
</div><!-- fragment --> </td></tr>
<tr>
<td>N-D <a class="el" href="classEigen_1_1Translation.html" title="Represents a translation transformation. ">Translation</a></td><td><div class="fragment"><div class="line">Translation&lt;float,2&gt;(tx, ty)</div>
<div class="line">Translation&lt;float,3&gt;(tx, ty, tz)</div>
<div class="line">Translation&lt;<span class="keywordtype">float</span>,N&gt;(s)</div>
<div class="line">Translation&lt;<span class="keywordtype">float</span>,N&gt;(vecN)</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>N-D <a class="el" href="group__TutorialGeometry.html#TutorialGeoTransform">Affine transformation</a></td><td><div class="fragment"><div class="line">Transform&lt;float,N,Affine&gt; t = concatenation_of_any_transformations;</div>
<div class="line">Transform&lt;float,3,Affine&gt; t = Translation3f(p) * <a class="code" href="group__Geometry__Module.html#ga811d6fdab2002723bc7a72f055ce8c1d">AngleAxisf</a>(a,axis) * <a class="code" href="classScaling.html">Scaling</a>(s);</div>
</div><!-- fragment --> </td></tr>
<tr>
<td>N-D Linear transformations <br/>
<em class="note">(pure rotations, <br/>
 scaling, etc.)</em></td><td><div class="fragment"><div class="line">Matrix&lt;float,N&gt; t = concatenation_of_rotations_and_scalings;</div>
<div class="line">Matrix&lt;float,2&gt; t = <a class="code" href="group__Geometry__Module.html#ga9a907f59280ce5650106a74904bab16d">Rotation2Df</a>(a) * <a class="code" href="classScaling.html">Scaling</a>(s);</div>
<div class="line">Matrix&lt;float,3&gt; t = <a class="code" href="group__Geometry__Module.html#ga811d6fdab2002723bc7a72f055ce8c1d">AngleAxisf</a>(a,axis) * <a class="code" href="classScaling.html">Scaling</a>(s);</div>
</div><!-- fragment --> </td></tr>
</table>
<p><b>Notes on rotations</b><br/>
 To transform more than a single vector the preferred representations are rotation matrices, while for other usages <a class="el" href="classEigen_1_1Quaternion.html" title="The quaternion class used to represent 3D orientations and rotations. ">Quaternion</a> is the representation of choice as they are compact, fast and stable. Finally <a class="el" href="classEigen_1_1Rotation2D.html" title="Represents a rotation/orientation in a 2 dimensional space. ">Rotation2D</a> and <a class="el" href="classEigen_1_1AngleAxis.html" title="Represents a 3D rotation as a rotation angle around an arbitrary 3D axis. ">AngleAxis</a> are mainly convenient types to create other rotation objects.</p>
<p><b>Notes on <a class="el" href="classEigen_1_1Translation.html" title="Represents a translation transformation. ">Translation</a> and <a class="el" href="classScaling.html" title="Represents a generic uniform scaling transformation. ">Scaling</a></b><br/>
 Like <a class="el" href="classEigen_1_1AngleAxis.html" title="Represents a 3D rotation as a rotation angle around an arbitrary 3D axis. ">AngleAxis</a>, these classes were designed to simplify the creation/initialization of linear (<a class="el" href="classEigen_1_1Matrix.html" title="The matrix class, also used for vectors and row-vectors. ">Matrix</a>) and affine (<a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a>) transformations. Nevertheless, unlike <a class="el" href="classEigen_1_1AngleAxis.html" title="Represents a 3D rotation as a rotation angle around an arbitrary 3D axis. ">AngleAxis</a> which is inefficient to use, these classes might still be interesting to write generic and efficient algorithms taking as input any kind of transformations.</p>
<p>Any of the above transformation types can be converted to any other types of the same nature, or to a more generic type. Here are some additional examples: </p>
<table  class="manual">
<tr>
<td><div class="fragment"><div class="line"><a class="code" href="group__Geometry__Module.html#ga9a907f59280ce5650106a74904bab16d">Rotation2Df</a> r;  r  = <a class="code" href="group__matrixtypedefs.html#ga535a919504bb3bc463b8995c196c1eed">Matrix2f</a>(..);       <span class="comment">// assumes a pure rotation matrix</span></div>
<div class="line"><a class="code" href="group__Geometry__Module.html#ga811d6fdab2002723bc7a72f055ce8c1d">AngleAxisf</a> aa;  aa = <a class="code" href="group__Geometry__Module.html#gaf65cf6f803890e57488d7de750bef682">Quaternionf</a>(..);</div>
<div class="line"><a class="code" href="group__Geometry__Module.html#ga811d6fdab2002723bc7a72f055ce8c1d">AngleAxisf</a> aa;  aa = <a class="code" href="group__matrixtypedefs.html#ga2b787393a7fc870d99aa634f60b2510c">Matrix3f</a>(..);       <span class="comment">// assumes a pure rotation matrix</span></div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga535a919504bb3bc463b8995c196c1eed">Matrix2f</a> m;     m  = <a class="code" href="group__Geometry__Module.html#ga9a907f59280ce5650106a74904bab16d">Rotation2Df</a>(..);</div>
<div class="line"><a class="code" href="group__matrixtypedefs.html#ga2b787393a7fc870d99aa634f60b2510c">Matrix3f</a> m;     m  = <a class="code" href="group__Geometry__Module.html#gaf65cf6f803890e57488d7de750bef682">Quaternionf</a>(..);       <a class="code" href="group__matrixtypedefs.html#ga2b787393a7fc870d99aa634f60b2510c">Matrix3f</a> m;   m = <a class="code" href="classScaling.html">Scaling</a>(..);</div>
<div class="line"><a class="code" href="group__Geometry__Module.html#gaca1e57a15de08fe20c934c5600f19314">Affine3f</a> m;     m  = AngleAxis3f(..);       <a class="code" href="group__Geometry__Module.html#gaca1e57a15de08fe20c934c5600f19314">Affine3f</a> m;   m = <a class="code" href="classScaling.html">Scaling</a>(..);</div>
<div class="line"><a class="code" href="group__Geometry__Module.html#gaca1e57a15de08fe20c934c5600f19314">Affine3f</a> m;     m  = Translation3f(..);     <a class="code" href="group__Geometry__Module.html#gaca1e57a15de08fe20c934c5600f19314">Affine3f</a> m;   m = <a class="code" href="group__matrixtypedefs.html#ga2b787393a7fc870d99aa634f60b2510c">Matrix3f</a>(..);</div>
</div><!-- fragment --> </td></tr>
</table>
<p><a href="#" class="top">top</a></p>
<h1><a class="anchor" id="TutorialGeoCommontransformationAPI"></a>
Common API across transformation types</h1>
<p>To some extent, <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a>'s <a class="el" href="group__Geometry__Module.html">geometry module</a> allows you to write generic algorithms working on any kind of transformation representations: </p>
<table  class="manual">
<tr>
<td>Concatenation of two transformations</td><td><div class="fragment"><div class="line">gen1 * gen2;</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>Apply the transformation to a vector</td><td><div class="fragment"><div class="line">vec2 = gen1 * vec1;</div>
</div><!-- fragment --> </td></tr>
<tr>
<td>Get the inverse of the transformation</td><td><div class="fragment"><div class="line">gen2 = gen1.inverse();</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>Spherical interpolation <br/>
 (<a class="el" href="classEigen_1_1Rotation2D.html" title="Represents a rotation/orientation in a 2 dimensional space. ">Rotation2D</a> and <a class="el" href="classEigen_1_1Quaternion.html" title="The quaternion class used to represent 3D orientations and rotations. ">Quaternion</a> only)</td><td><div class="fragment"><div class="line">rot3 = rot1.slerp(alpha,rot2);</div>
</div><!-- fragment --> </td></tr>
</table>
<p><a href="#" class="top">top</a></p>
<h1><a class="anchor" id="TutorialGeoTransform"></a>
Affine transformations</h1>
<p>Generic affine transformations are represented by the <a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a> class which internaly is a (Dim+1)^2 matrix. In <a class="el" href="namespaceEigen.html" title="Namespace containing all symbols from the Eigen library. ">Eigen</a> we have chosen to not distinghish between points and vectors such that all points are actually represented by displacement vectors from the origin ( <img class="formulaInl" alt="$ \mathbf{p} \equiv \mathbf{p}-0 $" src="form_184.png"/> ). With that in mind, real points and vector distinguish when the transformation is applied. </p>
<table  class="manual">
<tr>
<td>Apply the transformation to a <b>point</b> </td><td><div class="fragment"><div class="line">VectorNf p1, p2;</div>
<div class="line">p2 = t * p1;</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>Apply the transformation to a <b>vector</b> </td><td><div class="fragment"><div class="line">VectorNf vec1, vec2;</div>
<div class="line">vec2 = t.linear() * vec1;</div>
</div><!-- fragment --> </td></tr>
<tr>
<td>Apply a <em>general</em> transformation <br/>
 to a <b>normal</b> <b>vector</b> (<a href="http://www.cgafaq.info/wiki/Transforming_normals">explanations</a>)</td><td><div class="fragment"><div class="line">VectorNf n1, n2;</div>
<div class="line">MatrixNf normalMatrix = t.linear().inverse().transpose();</div>
<div class="line">n2 = (normalMatrix * n1).normalized();</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>Apply a transformation with <em>pure</em> <em>rotation</em> <br/>
 to a <b>normal</b> <b>vector</b> (no scaling, no shear)</td><td><div class="fragment"><div class="line">n2 = t.linear() * n1;</div>
</div><!-- fragment --> </td></tr>
<tr>
<td>OpenGL compatibility <b>3D</b> </td><td><div class="fragment"><div class="line">glLoadMatrixf(t.data());</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>OpenGL compatibility <b>2D</b> </td><td><div class="fragment"><div class="line"><a class="code" href="group__Geometry__Module.html#gaca1e57a15de08fe20c934c5600f19314">Affine3f</a> aux(<a class="code" href="classEigen_1_1Transform.html#a70ece05618a24131d9bf29162a700c58">Affine3f::Identity</a>());</div>
<div class="line">aux.linear().topLeftCorner&lt;2,2&gt;() = t.linear();</div>
<div class="line">aux.translation().start&lt;2&gt;() = t.translation();</div>
<div class="line">glLoadMatrixf(aux.data());</div>
</div><!-- fragment --> </td></tr>
</table>
<p><b>Component</b> <b>accessors</b> </p>
<table  class="manual">
<tr>
<td>full read-write access to the internal matrix</td><td><div class="fragment"><div class="line">t.matrix() = matN1xN1;    <span class="comment">// N1 means N+1</span></div>
<div class="line">matN1xN1 = t.matrix();</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>coefficient accessors</td><td><div class="fragment"><div class="line">t(i,j) = scalar;   &lt;=&gt;   t.matrix()(i,j) = scalar;</div>
<div class="line">scalar = t(i,j);   &lt;=&gt;   scalar = t.matrix()(i,j);</div>
</div><!-- fragment --> </td></tr>
<tr>
<td>translation part</td><td><div class="fragment"><div class="line">t.translation() = vecN;</div>
<div class="line">vecN = t.translation();</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>linear part</td><td><div class="fragment"><div class="line">t.linear() = matNxN;</div>
<div class="line">matNxN = t.linear();</div>
</div><!-- fragment --> </td></tr>
<tr>
<td>extract the rotation matrix</td><td><div class="fragment"><div class="line">matNxN = t.rotation();</div>
</div><!-- fragment --> </td></tr>
</table>
<p><b>Transformation</b> <b>creation</b> <br/>
While transformation objects can be created and updated concatenating elementary transformations, the <a class="el" href="classEigen_1_1Transform.html" title="Represents an homogeneous transformation in a N dimensional space. ">Transform</a> class also features a procedural API: </p>
<table  class="manual">
<tr>
<th></th><th>procedural API</th><th>equivalent natural API  </th></tr>
<tr>
<td><a class="el" href="classEigen_1_1Translation.html" title="Represents a translation transformation. ">Translation</a></td><td><div class="fragment"><div class="line">t.translate(Vector_(tx,ty,..));</div>
<div class="line">t.pretranslate(Vector_(tx,ty,..));</div>
</div><!-- fragment --></td><td><div class="fragment"><div class="line">t *= Translation_(tx,ty,..);</div>
<div class="line">t = Translation_(tx,ty,..) * t;</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td><b>Rotation</b> <br/>
 <em class="note">In 2D and for the procedural API, any_rotation can also <br/>
 be an angle in radian</em></td><td><div class="fragment"><div class="line">t.rotate(any_rotation);</div>
<div class="line">t.prerotate(any_rotation);</div>
</div><!-- fragment --></td><td><div class="fragment"><div class="line">t *= any_rotation;</div>
<div class="line">t = any_rotation * t;</div>
</div><!-- fragment --> </td></tr>
<tr>
<td><a class="el" href="classScaling.html" title="Represents a generic uniform scaling transformation. ">Scaling</a></td><td><div class="fragment"><div class="line">t.scale(Vector_(sx,sy,..));</div>
<div class="line">t.scale(s);</div>
<div class="line">t.prescale(Vector_(sx,sy,..));</div>
<div class="line">t.prescale(s);</div>
</div><!-- fragment --></td><td><div class="fragment"><div class="line">t *= <a class="code" href="classScaling.html">Scaling</a>(sx,sy,..);</div>
<div class="line">t *= <a class="code" href="classScaling.html">Scaling</a>(s);</div>
<div class="line">t = <a class="code" href="classScaling.html">Scaling</a>(sx,sy,..) * t;</div>
<div class="line">t = <a class="code" href="classScaling.html">Scaling</a>(s) * t;</div>
</div><!-- fragment --> </td></tr>
<tr class="alt">
<td>Shear transformation <br/>
 ( <b>2D</b> <b>only</b> ! )</td><td><div class="fragment"><div class="line">t.shear(sx,sy);</div>
<div class="line">t.preshear(sx,sy);</div>
</div><!-- fragment --></td><td></td></tr>
</table>
<p>Note that in both API, any many transformations can be concatenated in a single expression as shown in the two following equivalent examples: </p>
<table  class="manual">
<tr>
<td><div class="fragment"><div class="line">t.pretranslate(..).rotate(..).translate(..).scale(..);</div>
</div><!-- fragment --> </td></tr>
<tr>
<td><div class="fragment"><div class="line">t = Translation_(..) * t * RotationType(..) * Translation_(..) * <a class="code" href="classScaling.html">Scaling</a>(..);</div>
</div><!-- fragment --> </td></tr>
</table>
<p><a href="#" class="top">top</a></p>
<h1><a class="anchor" id="TutorialGeoEulerAngles"></a>
Euler angles</h1>
<table  class="manual">
<tr>
<td style="max-width:30em;">Euler angles might be convenient to create rotation objects. On the other hand, since there exist 24 different conventions, they are pretty confusing to use. This example shows how to create a rotation matrix according to the 2-1-2 convention.</td><td><div class="fragment"><div class="line"><a class="code" href="group__matrixtypedefs.html#ga2b787393a7fc870d99aa634f60b2510c">Matrix3f</a> m;</div>
<div class="line">m = <a class="code" href="group__Geometry__Module.html#ga811d6fdab2002723bc7a72f055ce8c1d">AngleAxisf</a>(angle1, <a class="code" href="classEigen_1_1MatrixBase.html#a135f14351a7213bf0b764272c14ca68c">Vector3f::UnitZ</a>())</div>
<div class="line">*  * <a class="code" href="group__Geometry__Module.html#ga811d6fdab2002723bc7a72f055ce8c1d">AngleAxisf</a>(angle2, <a class="code" href="classEigen_1_1MatrixBase.html#abc925a22c4f4b48b5b10fa90924f14c1">Vector3f::UnitY</a>())</div>
<div class="line">*  * <a class="code" href="group__Geometry__Module.html#ga811d6fdab2002723bc7a72f055ce8c1d">AngleAxisf</a>(angle3, <a class="code" href="classEigen_1_1MatrixBase.html#a135f14351a7213bf0b764272c14ca68c">Vector3f::UnitZ</a>());</div>
</div><!-- fragment --> </td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Oct 28 2013 11:04:27 for Eigen by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.5 </li>
  </ul>
</div>
<!-- Piwik --> 
<!--
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://stats.sylphide-consulting.com/piwik/" : "http://stats.sylphide-consulting.com/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 20);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://stats.sylphide-consulting.com/piwik/piwik.php?idsite=20" style="border:0" alt="" /></p></noscript>
-->
<!-- End Piwik Tracking Code -->
</body>
</html>