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 {
    var l = length;
    if (l == 0.0) {
      return;
    }
    l = value / l;
    _v3storage[0] *= l;
    _v3storage[1] *= l;
    _v3storage[2] *= l;
  }
}