MKI_MATRIX (Basic Classes) Changed in Version 2025.1

www.CAD6.com

This class contains a 3 x 2 matrix for 2D modification purposes.

 

C++ Syntax

class MKI_MATRIX

{

  double m11, m12,

         m21, m22,

         m31, m32;

 

  MKI_MATRIX( void );

 

  MKI_MATRIX(

 const MKI_MATRIX* f_pThis );

 

  MKI_MATRIX(

 const double f_dM11,

 const double f_dM12,

 const double f_dM21,

 const double f_dM22,

 const double f_dM31,

 const double f_dM32 );

 

  double

  x(

 const double f_dX,

 const double f_dY ) const;

 

  double

  x(

 const MKI_POINT& f_rPoint ) const;

 

  double

  x(

 const MKI_VECTOR& f_rVector ) const;

 

  double

  y(

 const double f_dX,

 const double f_dY ) const;

 

  double

  y(

 const MKI_POINT& f_rPoint ) const;

 

  double

  y(

 const MKI_VECTOR& f_rVector ) const;

 

  MKI_POINT

  Point(

 const double f_dX,

 const double f_dY ) const;

 

  MKI_POINT

  Point(

 const MKI_POINT& f_rPoint ) const;

 

  MKI_POINT_REF

  GetTranslation( void ) const;

 

  void

  SetTranslation(

 MKI_CONST_POINT_REF f_rPoint );

 

  void

  SetTranslation(

 MKI_CONST_VECTOR_REF f_rVector );

 

  void

  SetTranslation(

 const double f_dX,

 const double f_dY );

 

  void

  ApplyPoint(

 double& f_rdX,

 double& f_rdY ) const;

 

  void

  ApplyPoint(

 MKI_POINT& f_rPoint ) const;

 

  void

  ApplyPoint(

 MKI_MATRIX& f_rMatrix ) const;

 

  double

  dx(

 const double f_dX,

 const double f_dY ) const;

 

  double

  dx(

 const MKI_POINT& f_rPoint ) const;

 

  double

  dx(

 const MKI_VECTOR& f_rVector ) const;

 

  double

  dy(

 const double f_dX,

 const double f_dY ) const;

 

  double

  dy(

 const MKI_POINT& f_rPoint ) const;

 

  double

  dy(

 const MKI_VECTOR& f_rVector ) const;

 

  void

  Init( void );

 

  void

  SetZero( void );

 

  void

  Rotate(

 const double f_dAlpha );

 

  void

  RotateFix(

 const double f_dAlpha );

 

  void

  Distort(

 const double f_dAlpha,

 const double f_dBeta ); New in Version 2024.1

 

  void

  DistortX(

 const double f_dAlpha );

 

  void

  DistortY(

 const double f_dBeta );

 

  void

  Move(

 const double f_dX,

 const double f_dY );

 

  void

  Move(

 const MKI_VECTOR& f_rVector );

 

  void

  Scale(

 const double f_dX,

 const double f_dY );

 

  void

  Scale(

 const double f_dFactor );

 

  void

  Scale(

 const MKI_VECTOR& f_rVector );

 

  void

  ScaleFix(

 const double f_dX,

 const double f_dY );

 

  void

  ScaleFix(

 const double f_dFactor );

 

  void

  ScaleFix(

 const MKI_VECTOR& f_rVector );

 

  void

  MirrorX( void );

 

  void

  MirrorY( void );

 

  void

  SetMultiply(

 const MKI_MATRIX& f_rBase,

 const MKI_MATRIX& f_rFactor );

 

  void

  Multiply(

 const MKI_MATRIX& f_rFactor );

 

  double

  Determinant( void ) const;

 

  bool

  SetInvert(

 const MKI_MATRIX& f_rSource );

 

  bool

  Invert( void );

 

  void

  SetFitAlign(

 const MKI_RECT& f_rRect,

 double f_dX,

 double f_dY,

     __int32 f_nFitMode,

 double f_dFitSizeX,

 double f_dFitSizeY,

 __int32 f_nAlignMode ); New in Version 2025.1

 

  bool

  IsMirrorMatrix( void ) const;

 

  bool

  IsNonscaleMatrix( void ) const;

 

  bool

  IsDistortMatrix( void ) const;

 

  double

  GetScaling( void ) const;

 

  double

  GetTextHeight( void ) const;

 

  double

  GetRotation( void ) const;

 

  bool

  Separate(

 double& f_rdScaleX,

 double& f_rdScaleY,

 double& f_rdRotation,

 double& f_rdDistortion,

 double& f_rdMoveX,

 double& f_rdMoveY ) const;

 

  void

  Assemble(

 const double f_dScaleX,

 const double f_dScaleY,

 const double f_dRotation,

 const double f_dDistortion,

 const double f_dMoveX,

 const double f_dMoveY );

 

  bool

  SeparateText(

 double& f_rdHeight,

 double& f_rdCompression,

 double& f_rdRotation,

 double& f_rdDistortion,

 double& f_rdMoveX,

 double& f_rdMoveY ) const;

 

  void

  AssembleText(

 const double f_dHeight,

 const double f_dCompression,

 const double f_dRotation,

 const double f_dDistortion,

 const double f_dMoveX,

 const double f_dMoveY );

 

  bool

  IsIdentical(

 const MKI_MATRIX& f_rMatrix ) const;

};

 

Element Description

m11, m12

[double] First line of a 3 × 2 matrix.

m21, m22

[double] Second line of a 3 × 2 matrix.

m31, m32

[double] Third line of a 3 × 2 matrix.

 

Comment

The data type MKI_MATRIX is used to store a 3 × 3 matrix. Such matrices are used to store a combination of one or more of the following operations: translation (moving), scaling, rotation, distortion and mirroring. To store all of these operations, a 3 × 3 matrix is required. 3 × 3 matrices use the following representation:

 

 [ m11 m12 m13 ]

 [ m21 m22 m23 ]

 [ m31 m32 m33 ]

 

As the CAD6interface only handles two-dimensional data and therefore only two-dimensional operations, all resulting matrices have the following, simplified form:

 

 [ m11 m12 0.0 ]

 [ m21 m22 0.0 ]

 [ m31 m32 1.0 ]

 

Due to this simplification, only the first two columns of the matrix are stored. The third column is set to [0.0 0.0 1.0]T implicitly.

 

Example

1.0,0.0,0.0,1.0,0.0,0.0

 

These six values describe the first two columns of the 3 × 3 identity matrix (see Matrices and Vectors). The third column is to be set to [0.0 0.0 1.0]T, so the resulting matrix is:

 

 [ 1.0 0.0 0.0 ]

 [ 0.0 1.0 0.0 ]

 [ 0.0 0.0 1.0 ]

 

MKD Syntax

m11,m12,m21,m22,m31,m32

 

CAD6interface 2026.1 - Copyright 2026 Malz++Kassner® GmbH