MCPcopy
hub / github.com/mrdoob/three.js / normalize

Method normalize

src/math/Vector3.js:792–796  ·  view source on GitHub ↗

* Converts this vector to a unit vector - that is, sets it equal to a vector * with the same direction as this one, but with a vector length of `1`. * * @return {Vector3} A reference to this vector.

()

Source from the content-addressed store, hash-verified

790 * @return {Vector3} A reference to this vector.
791 */
792 normalize() {
793
794 return this.divideScalar( this.length() || 1 );
795
796 }
797
798 /**
799 * Sets this vector to a vector with the same direction as this one, but

Callers 15

applyRadiusMethod · 0.95
constructorMethod · 0.95
constructorMethod · 0.95
constructorMethod · 0.95
computeFrenetFramesMethod · 0.95
transformDirectionMethod · 0.95
setLengthMethod · 0.95
_generateSampleKernelMethod · 0.95
weightedNormalMethod · 0.95
getNormalNewellMethod · 0.95
_triangulateNGonMethod · 0.95

Calls 2

divideScalarMethod · 0.95
lengthMethod · 0.95

Tested by

no test coverage detected