squareMagnitudes method

Float64List squareMagnitudes()

Returns the square magnitudes of the elements of the Float64x2List.

If you need the squares of the magnitudes, this method is much more efficient than calling magnitudes then squaring those values.

Implementation

Float64List squareMagnitudes() {
  final m = Float64List(length);
  for (int i = 0; i < m.length; ++i) {
    final z = this[i];
    m[i] = z.x * z.x + z.y * z.y;
  }
  return m;
}