length property

double get length

Length.

Implementation

double get length => math.sqrt(length2);
set 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 {
    var l = length;
    if (l == 0.0) {
      return;
    }
    l = value / l;
    _v4storage[0] *= l;
    _v4storage[1] *= l;
    _v4storage[2] *= l;
    _v4storage[3] *= l;
  }
}