MCPcopy Index your code
hub / github.com/processing/processing / limit

Method limit

core/src/processing/core/PVector.java:842–848  ·  view source on GitHub ↗

( begin auto-generated from PVector_limit.xml ) Limit the magnitude of this vector to the value used for the max parameter. ( end auto-generated ) @webref pvector:method @usage web_application @param max the maximum magnitude for the vector @brief Limit the magnitude of the vector

(float max)

Source from the content-addressed store, hash-verified

840 * @brief Limit the magnitude of the vector
841 */
842 public PVector limit(float max) {
843 if (magSq() > max*max) {
844 normalize();
845 mult(max);
846 }
847 return this;
848 }
849
850
851 /**

Callers 1

RenameMethod · 0.80

Calls 3

magSqMethod · 0.95
normalizeMethod · 0.95
multMethod · 0.95

Tested by

no test coverage detected