GMatrix.fromList constructor

GMatrix.fromList(
  1. List<double> value
)

Creates a new GMatrix object from a list of 6 doubles.

The list is in the format [a, b, tx, c, d, ty], where:

  • a is the scale factor x of the horizontal axis.
  • b is the shear factor x of the vertical axis.
  • tx is the translation offset x of the horizontal axis.
  • c is the shear factor y of the horizontal axis.
  • d is the scale factor y of the vertical axis.
  • ty is the translation offset y of the vertical axis.

The matrix elements are numbered as follows:

    [ a,  c,  tx ]
    [ b,  d,  ty ]
    [ 0,  0,  1  ]

Throws a RangeError if value does not have at least 6 elements.

Implementation

GMatrix.fromList(List<double> value) {
  if (value.length < 6) {
    throw RangeError('List must have at least 6 elements');
  }
  a = value[0];
  b = value[1];
  c = value[3];
  d = value[4];
  tx = value[2];
  ty = value[5];
}