toMatrix method

List<List<num>> toMatrix()

Returns the 2x2 matrix representation of this complex number

Implementation

List<List<num>> toMatrix() {
  return [
    [real, -imaginary],
    [imaginary, real]
  ];
}