MCPcopy Index your code
hub / github.com/benfry/processing4 / limit

Method limit

core/src/processing/core/PVector.java:810–816  ·  view source on GitHub ↗

Limit the magnitude of this vector to the value used for the max parameter. @webref pvector:method @usage web_application @param max the maximum magnitude for the vector @webBrief Limit the magnitude of the vector

(float max)

Source from the content-addressed store, hash-verified

808 * @webBrief Limit the magnitude of the vector
809 */
810 public PVector limit(float max) {
811 if (magSq() > max*max) {
812 normalize();
813 mult(max);
814 }
815 return this;
816 }
817
818
819 /**

Callers 1

RenameMethod · 0.80

Calls 3

magSqMethod · 0.95
normalizeMethod · 0.95
multMethod · 0.95

Tested by

no test coverage detected