length property

double length

Length.

Implementation

double get length => math.sqrt(length2);
void length= (double value)

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;
    _v4storage[0] *= l;
    _v4storage[1] *= l;
    _v4storage[2] *= l;
    _v4storage[3] *= l;
  }
}