FL.objects.Matrix.Matrix

class FL.objects.Matrix.Matrix(a: Matrix | list[float] | float | None = None, b: float | None = None, c: float | None = None, d: float | None = None, e: float | None = None, f: float | None = None)

Bases: Copyable

Matrix - class to represent planar transformations

__init__(a: Matrix | list[float] | float | None = None, b: float | None = None, c: float | None = None, d: float | None = None, e: float | None = None, f: float | None = None) None
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

Parameters:
  • a (Matrix | list[float] | float | None, optional) –

    1. Defaults to None.

  • b (float | None, optional) – xy. Defaults to None.

  • c (float | None, optional) – yx. Defaults to None.

  • d (float | None, optional) – yy. Defaults to None.

  • e (float | None, optional) –

    1. Defaults to None.

  • f (float | None, optional) – dy. Defaults to None.

Methods

Add(m)

Adds values of the Matrix m to current matrix

Assign(a[, b, c, d, e, f])

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

Mul(s)

Mutiplies Matrix's parameters to s value

Sub(m)

Subtracts values of the Matrix m from current matrix

Transform(m)

Applies Matrix m transformation to the current Matrix

__init__([a, b, c, d, e, f])

Matrix()

fake_transform_point(p)

Matrix is used to perform following transformations:

Attributes

a

b

c

d

e

f

Add(m: Matrix) None

Adds values of the Matrix m to current matrix

Assign(a: Matrix | list[float] | float | None, b: float | None = None, c: float | None = None, d: float | None = None, e: float | None = None, f: float | None = None) None

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

Mul(s: float) None

Mutiplies Matrix’s parameters to s value

Sub(m: Matrix) None

Subtracts values of the Matrix m from current matrix

Transform(m: Matrix) None

Applies Matrix m transformation to the current Matrix

fake_transform_point(p: Point) None

Matrix is used to perform following transformations:

x1 = x * a + y * b + e y1 = x * c + y * d + f

Parameters:

p (Point) – The point to be transformed