setMag method

PVector setMag(
  1. double len
)

( begin auto-generated from PVector_setMag.xml )

Set the magnitude of this vector to the value used for the len parameter.

( end auto-generated )

@webref pvector:method @usage web_application @param len the new length for this vector @brief Set the magnitude of the vector

Implementation

PVector setMag(double len) {
  normalize();
  mult(len);
  return this;
}