Download Now

    Reference TMatrix2x3

    Declared in Codebot.Graphics.Types.pas on line 338

    TMatrix2x3 is a 2d affine transform. Order determines if new operations are applied before or after the existing transform.
      TMatrix2x3 = record
      public
        { The fields of the matrix where M31 and M32 are the translation }
        M11: Float;
        M12: Float;
        M21: Float;
        M22: Float;
        M31: Float;
        M32: Float;
        { Determines if new operations are prepended or appended }
        Order: TMatrixOrder;
        { Create an identity matrix }
        class function Create: TMatrix2x3; static;
        { Returns true if the matrix can be inverted }
        function CanInvert: Boolean;
        { Reset to the identity matrix }
        procedure Identity;
        { Invert the matrix in place }
        procedure Invert;
        { Rotate by an angle in radians }
        procedure Rotate(Angle: Float);
        { Rotate by an angle in radians around a point }
        procedure RotateAt(Angle: Float; X, Y: Float); overload;
        procedure RotateAt(Angle: Float; const P: TPointF); overload;
        { Scale along each axis }
        procedure Scale(SX, SY: Float);
        { Scale along each axis around a point }
        procedure ScaleAt(SX, SY, X, Y: Float); overload;
        procedure ScaleAt(SX, SY: Float; const P: TPointF); overload;
        { Skew by angles in radians }
        procedure Skew(AngleX, AngleY: Float); overload;
        { Move along each axis }
        procedure Translate(X, Y: Float); overload;
        procedure Translate(const P: TPointF); overload;
        { Multiply by another matrix }
        function Multiply(const M: TMatrix2x3): TMatrix2x3; overload;
        { Transform a point }
        function Multiply(const P: TPointF): TPointF; overload;
      end;

    See also

    Float in Codebot.System.pas
    TMatrixOrder in Codebot.System.pas