.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.AffineMatrix2DBase:

==========================================================================================================================================
|phoenix_title|  **wx.AffineMatrix2DBase**
==========================================================================================================================================

A 2x3 matrix representing an affine ``2D`` transformation.          

This is an abstract base class implemented by :ref:`wx.AffineMatrix2D`  only so far, but in the future we also plan to derive :ref:`wx.GraphicsMatrix`  from it. 







         



.. versionadded:: 2.9.2 
     







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>AffineMatrix2DBase</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.AffineMatrix2DBase_inheritance.png" alt="Inheritance diagram of AffineMatrix2DBase" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.AffineMatrix2DBase.html" title="wx.AffineMatrix2DBase" alt="" coords="5,5,180,35"/> </map> 
   </p>
   </div>

|


|sub_classes| Known Subclasses
==============================

:ref:`wx.AffineMatrix2D`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.AffineMatrix2DBase.__init__`                                          Default constructor.
:meth:`~wx.AffineMatrix2DBase.Concat`                                            Concatenate this matrix with another one.
:meth:`~wx.AffineMatrix2DBase.Get`                                               Get the component values of the matrix.
:meth:`~wx.AffineMatrix2DBase.Invert`                                            Invert this matrix.
:meth:`~wx.AffineMatrix2DBase.IsEqual`                                           Check that this matrix is identical with `t`.
:meth:`~wx.AffineMatrix2DBase.IsIdentity`                                        Check if this is the identity matrix.
:meth:`~wx.AffineMatrix2DBase.Mirror`                                            Add mirroring to this matrix.
:meth:`~wx.AffineMatrix2DBase.Rotate`                                            Add clockwise rotation to this matrix.
:meth:`~wx.AffineMatrix2DBase.Scale`                                             Add scaling to this matrix.
:meth:`~wx.AffineMatrix2DBase.Set`                                               Set all elements of this matrix.
:meth:`~wx.AffineMatrix2DBase.TransformDistance`                                 Applies the linear part of this matrix, i.e. without translation.
:meth:`~wx.AffineMatrix2DBase.TransformPoint`                                    Applies this matrix to the point.
:meth:`~wx.AffineMatrix2DBase.Translate`                                         Add the translation to this matrix.
:meth:`~wx.AffineMatrix2DBase.__ne__`                                            Check that this matrix differs from `t`.
:meth:`~wx.AffineMatrix2DBase.__eq__`                                            Check that this matrix is identical with `t`.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.AffineMatrix2DBase(object)

   **Possible constructors**::

       AffineMatrix2DBase()
       
   
   A 2x3 matrix representing an affine ``2D`` transformation.



   .. method:: __init__(self)

      Default constructor.                  

      The matrix elements are initialize to the identity matrix.                   





   .. method:: Concat(self, t)

      Concatenate this matrix with another one.                  

      The parameter matrix is the multiplicand. 




      :param `t`: The multiplicand.  
      :type `t`: wx.AffineMatrix2DBase




      ::

                  #           | t.m_11  t.m_12  0 |   | m_11  m_12   0 |
                  # matrix' = | t.m_21  t.m_22  0 | x | m_21  m_22   0 |
                  #           | t.m_tx  t.m_ty  1 |   | m_tx  m_ty   1 |

                  





   .. method:: Get(self)

      Get the component values of the matrix.                  







      :rtype: `tuple`



                  



      :returns: 

         ( `mat2D`, `tr` ) 








   .. method:: Invert(self)

      Invert this matrix.                  

      If the matrix is not invertible, i.e. if its determinant is 0, returns ``False`` and doesn't modify it. 

      ::

                  #           | m_11  m_12  0 |
                  # Invert    | m_21  m_22  0 |
                  #           | m_tx  m_ty  1 |

                 

      :rtype: `bool`








   .. method:: IsEqual(self, t)

      Check that this matrix is identical with `t`.                  




      :param `t`: The matrix compared with this.   
      :type `t`: wx.AffineMatrix2DBase






      :rtype: `bool`



                  





   .. method:: IsIdentity(self)

      Check if this is the identity matrix.                  

      :rtype: `bool`








   .. method:: Mirror(self, direction=HORIZONTAL)

      Add mirroring to this matrix.                  




      :param `direction`: The direction(s) used for mirroring. One of ``wx.HORIZONTAL``, ``wx.VERTICAL`` or their combination ``wx.BOTH``.   
      :type `direction`: int




                  





   .. method:: Rotate(self, cRadians)

      Add clockwise rotation to this matrix.                  




      :param `cRadians`: Rotation angle in radians, clockwise.   
      :type `cRadians`: wx.Double




                  





   .. method:: Scale(self, xScale, yScale)

      Add scaling to this matrix.                  




      :param `xScale`: Scaling in x direction.   
      :type `xScale`: wx.Double
      :param `yScale`: Scaling in y direction.   
      :type `yScale`: wx.Double






                  





   .. method:: Set(self, mat2D, tr)

      Set all elements of this matrix.                  




      :param `mat2D`: The rotational components of the matrix (upper 2 x 2).   
      :type `mat2D`: wx.Matrix2D
      :param `tr`: The translational components of the matrix.   
      :type `tr`: Point2DDouble






                  





   .. method:: TransformDistance(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **TransformDistance** `(self, p)`
      
      Applies the linear part of this matrix, i.e. without translation.                  
      
      
      
      
      :param `p`: The source receiving the transformations.  
      :type `p`: Point2DDouble
      
      
      
      
      
      
      :rtype: :ref:`Point2DDouble`
      
      
      
                        
      
      
      
      :returns: 
      
         The source with the transformations applied.   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **TransformDistance** `(self, dx, dy)`
      
      
      
      
      :param `dx`: 
      :type `dx`: wx.Double
      :param `dy`: 
      :type `dy`: wx.Double
      
      
      
      
      :rtype: `tuple`
      
      
      
      
      
      
      
      :returns: 
      
         ( `dx`, `dy` ) 
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: TransformPoint(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **TransformPoint** `(self, p)`
      
      Applies this matrix to the point.                  
      
      
      
      
      :param `p`: The point receiving the transformations.  
      :type `p`: Point2DDouble
      
      
      
      
      
      
      :rtype: :ref:`Point2DDouble`
      
      
      
                        
      
      
      
      :returns: 
      
         The point with the transformations applied.   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **TransformPoint** `(self, x, y)`
      
      
      
      
      :param `x`: 
      :type `x`: wx.Double
      :param `y`: 
      :type `y`: wx.Double
      
      
      
      
      :rtype: `tuple`
      
      
      
      
      
      
      
      :returns: 
      
         ( `x`, `y` ) 
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Translate(self, dx, dy)

      Add the translation to this matrix.                  




      :param `dx`: The translation in x direction.   
      :type `dx`: wx.Double
      :param `dy`: The translation in y direction.   
      :type `dy`: wx.Double






                  





   .. method:: __ne__(self)

      Check that this matrix differs from `t`.                  




      :param `t`: The matrix compared with this.   
      :type `t`: wx.AffineMatrix2DBase




                  





   .. method:: __eq__(self)

      Check that this matrix is identical with `t`.                  




      :param `t`: The matrix compared with this.   
      :type `t`: wx.AffineMatrix2DBase




                  




