Skip to content

hom_mat2d_composeHomMat2dComposeHomMat2dComposehom_mat2d_composeT_hom_mat2d_compose🔗

Short description🔗

hom_mat2d_composeHomMat2dComposeHomMat2dComposehom_mat2d_composeT_hom_mat2d_compose — Multiply two homogeneous 2D transformation matrices.

Signature🔗

hom_mat2d_compose( hom_mat2d HomMat2DLeft, hom_mat2d HomMat2DRight, out hom_mat2d HomMat2DCompose )void HomMat2dCompose( const HTuple& HomMat2DLeft, const HTuple& HomMat2DRight, HTuple* HomMat2DCompose )static void HOperatorSet.HomMat2dCompose( HTuple homMat2DLeft, HTuple homMat2DRight, out HTuple homMat2DCompose )def hom_mat2d_compose( hom_mat_2dleft: Sequence[float], hom_mat_2dright: Sequence[float] ) -> Sequence[float]

Herror T_hom_mat2d_compose( const Htuple HomMat2DLeft, const Htuple HomMat2DRight, Htuple* HomMat2DCompose )

HHomMat2D HHomMat2D::HomMat2dCompose( const HHomMat2D& HomMat2DRight ) const

HHomMat2D HHomMat2D.HomMat2dCompose( HHomMat2D homMat2DRight )

Description🔗

hom_mat2d_composeHomMat2dCompose composes a new 2D transformation matrix by multiplying the two input matrices:

\[\begin{eqnarray*} \textrm{HomMat2DCompose} = \textrm{HomMat2DLeft} \cdot \textrm{HomMat2DRight} \end{eqnarray*}\]

For example, if the two input matrices correspond to rigid transformations, i.e., to transformations consisting of a rotation and a translation, the resulting matrix is calculated as follows:

\[\begin{eqnarray*} \textrm{HomMat2DCompose} = \mvHomMatrixTwoDRotTrans{\mvRotationMatrixVar{}{l}} {\mvTranslationVectorVar{}{l}} \cdot \mvHomMatrixTwoDRotTrans{\mvRotationMatrixVar{}{r}} {\mvTranslationVectorVar{}{r}} = \mvHomMatrixTwoDRotTrans{ \mvRotationMatrixVar{}{l} \cdot \mvRotationMatrixVar{}{r}}{ \mvRotationMatrixVar{}{l} \cdot \mvTranslationVectorVar{}{r} + \mvTranslationVectorVar{}{l}} \end{eqnarray*}\]

Attention🔗

Note that homogeneous matrices are stored row-by-row as a tuple; the last row is usually not stored because it is identical for all homogeneous matrices that describe an affine transformation. For example, the homogeneous matrix \(\mvHomMatrixTwoDElements{ra & rb & tc \\ rd & re & tf}\) is stored as the tuple [ra, rb, tc, rd, re, tf]. However, it is also possible to process full 3×3 matrices, which represent a projective 2D transformation.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

HomMat2DLefthomMat2DLefthom_mat_2dleft (input_control) hom_mat2d → (real)HTuple (double)HHomMat2D, HTuple (double)Sequence[float]Htuple (double)

Left input transformation matrix.

HomMat2DRighthomMat2DRighthom_mat_2dright (input_control) hom_mat2d → (real)HTuple (double)HHomMat2D, HTuple (double)Sequence[float]Htuple (double)

Right input transformation matrix.

HomMat2DComposehomMat2DComposehom_mat_2dcompose (output_control) hom_mat2d → (real)HTuple (double)HHomMat2D, HTuple (double)Sequence[float]Htuple (double)

Output transformation matrix.

Result🔗

If the parameters are valid, the operator hom_mat2d_composeHomMat2dCompose returns 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

hom_mat2d_composeHomMat2dCompose, hom_mat2d_translateHomMat2dTranslate, hom_mat2d_translate_localHomMat2dTranslateLocal, hom_mat2d_scaleHomMat2dScale, hom_mat2d_scale_localHomMat2dScaleLocal, hom_mat2d_rotateHomMat2dRotate, hom_mat2d_rotate_localHomMat2dRotateLocal, hom_mat2d_slantHomMat2dSlant, hom_mat2d_slant_localHomMat2dSlantLocal, hom_mat2d_reflectHomMat2dReflect, hom_mat2d_reflect_localHomMat2dReflectLocal

Possible successors

hom_mat2d_composeHomMat2dCompose, hom_mat2d_translateHomMat2dTranslate, hom_mat2d_translate_localHomMat2dTranslateLocal, hom_mat2d_scaleHomMat2dScale, hom_mat2d_scale_localHomMat2dScaleLocal, hom_mat2d_rotateHomMat2dRotate, hom_mat2d_rotate_localHomMat2dRotateLocal, hom_mat2d_slantHomMat2dSlant, hom_mat2d_slant_localHomMat2dSlantLocal, hom_mat2d_reflectHomMat2dReflect, hom_mat2d_reflect_localHomMat2dReflectLocal

Module🔗

Foundation