MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / normalize

Method normalize

src/main/java/com/volmit/adapt/util/Vector2f.java:132–138  ·  view source on GitHub ↗

Sets the value of this vector to the normalization of vector v1. @param v1 the un-normalized vector

(Vector2f v1)

Source from the content-addressed store, hash-verified

130 * @param v1 the un-normalized vector
131 */
132 public final void normalize(Vector2f v1) {
133 float norm;
134
135 norm = (float) (1.0 / Math.sqrt(v1.x * v1.x + v1.y * v1.y));
136 this.x = v1.x * norm;
137 this.y = v1.y * norm;
138 }
139
140 /**
141 * Normalizes this vector in place.

Callers

nothing calls this directly

Calls 1

sqrtMethod · 0.80

Tested by

no test coverage detected