length property
Length.
Implementation
double get length => math.sqrt(length2);
Set the length of the vector. A negative value
will change the vectors
orientation and a value
of zero will set the vector to zero.
Implementation
set length(double value) {
if (value == 0.0) {
setZero();
} else {
double l = length;
if (l == 0.0) {
return;
}
l = value / l;
_v2storage[0] *= l;
_v2storage[1] *= l;
}
}