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

Method normalize

core/src/processing/core/PVector.java:773–779  ·  view source on GitHub ↗

Normalize the vector to length 1 (make it a unit vector). @webref pvector:method @usage web_application @webBrief Normalize the vector to a length of 1

()

Source from the content-addressed store, hash-verified

771 * @webBrief Normalize the vector to a length of 1
772 */
773 public PVector normalize() {
774 float m = mag();
775 if (m != 0 && m != 1) {
776 div(m);
777 }
778 return this;
779 }
780
781
782 /**

Callers 2

limitMethod · 0.95
setMagMethod · 0.95

Calls 3

magMethod · 0.95
divMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected