Skip to content

# `Matrix`

## FL.Matrix = class Matrix(object)

      ===============================================
        Matrix - class to represent planar transformations
      ===============================================
      Matrix is used to perform following transformations:
        x1 = x * a + y * b + e
        y1 = x * c + y * d + f

      CONSTRUCTOR:
        Matrix() - generic constructor, creates a Matrix that makes no change to coordinates
        Matrix(Matrix) - copy constructor
        Matrix([a, b, c, d, e, f]) - creates a Matrix and assigns coordinates from the list of float numbers
        Matrix(a, b, c, d, e, f) - creates a Matrix and assigns coordinates from float numbers

      ATTRIBUTES:
        a, b, c, d, e, f (float) - Matrix parameters

      OPERATIONS:
        add - Matrix must be second operand, all parameters are added
        subtract - Matrix must be second operand, all parameters are subtracted
        multiply (with Matrix) - matrixes are multiplied
        multiply (with float number) - all parameters are scaled by the operand

      METHODS
        Assign - assigns new values to a Matrix, uses the same syntax as in constructors
        Add(Matrix m) - adds values of the Matrix m to current matrix
        Sub(Matrix m) - subtracts values of the Matrix m from current matrix
        Mul(float s) - mutiplies Matrix's parameters to s value
        Transform(Matrix m) - applies Matrix m transformation to the current Matrix

#### Methods

Add(...)

      Add(Matrix m) - adds values of the Matrix m to current matrix

Assign(...)

      Assign - assigns new values to a Matrix, uses the same syntax as in constructors

Mul(...)

      Mul(float s) - mutiplies Matrix's parameters to s value

Sub(...)

      Sub(Matrix m) - subtracts values of the Matrix m from current matrix

Transform(...)

      Transform(Matrix m) - applies Matrix m transformation to the current Matrix

__add__(...)

      x.__add__(y) <==> x+y

__delattr__(...)

      x.__delattr__('name') <==> del x.name

__getattribute__(...)

      x.__getattribute__('name') <==> x.name

__init__(...)

      x.__init__(...) initializes x; see help(type(x)) for signature

__mul__(...)

      x.__mul__(y) <==> x*y

__radd__(...)

      x.__radd__(y) <==> y+x

__repr__(...)

      x.__repr__() <==> repr(x)

__rmul__(...)

      x.__rmul__(y) <==> y*x

__rsub__(...)

      x.__rsub__(y) <==> y-x

__setattr__(...)

      x.__setattr__('name', value) <==> x.name = value

__sub__(...)

      x.__sub__(y) <==> x-y

#### Descriptors

a

b

c

d

e

f

#### Attributes

__new__ = <built-in method __new__ of type object>

      T.__new__(S, ...) -> a new object with type S, a subtype of T

## `Add`

FL.Matrix.Add = Add(...)

      Add(Matrix m) - adds values of the Matrix m to current matrix

## `Assign`

FL.Matrix.Assign = Assign(...)

      Assign - assigns new values to a Matrix, uses the same syntax as in constructors

## `Mul`

FL.Matrix.Mul = Mul(...)

      Mul(float s) - mutiplies Matrix's parameters to s value

## `Sub`

FL.Matrix.Sub = Sub(...)

      Sub(Matrix m) - subtracts values of the Matrix m from current matrix

## `Transform`

FL.Matrix.Transform = Transform(...)

      Transform(Matrix m) - applies Matrix m transformation to the current Matrix