magnitude method
Implementation
double magnitude() {
if (_magnitude > 0) return _magnitude;
double sumOfSquares = 0;
int elementsLength = elements.length;
for (var i = 1; i < elementsLength; i += 2) {
var val = elements[i];
sumOfSquares += val * val;
}
return _magnitude = sqrt(sumOfSquares);
}