format method

String format([
  1. int x0 = 0,
  2. int? y0,
  3. int? z0,
  4. int? w0,
])

Returns a formatted string representation of this quaternion.

x0 sets the default precision for all components; individual overrides can be provided via y0, z0, and w0.

Example: [ <x>, <y>, <z>, <w> ]

Implementation

String format([int x0 = 0, int? y0, int? z0, int? w0]) =>
  '[ '
    '${x.toStringAsFixed(x0)}, '
    '${y.toStringAsFixed(y0 ?? x0)}, '
    '${z.toStringAsFixed(z0 ?? x0)}, '
    '${w.toStringAsFixed(w0 ?? x0)} '
  ']';