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

Method angle

src/main/java/com/volmit/adapt/util/Vector3f.java:182–187  ·  view source on GitHub ↗

Returns the angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI]. @param v1 the other vector @return the angle in radians in the range [0,PI]

(Vector3f v1)

Source from the content-addressed store, hash-verified

180 * @return the angle in radians in the range [0,PI]
181 */
182 public final float angle(Vector3f v1) {
183 double vDot = this.dot(v1) / (this.length() * v1.length());
184 if (vDot < -1.0) vDot = -1.0;
185 if (vDot > 1.0) vDot = 1.0;
186 return ((float) (Math.acos(vDot)));
187 }
188
189}

Callers

nothing calls this directly

Calls 2

dotMethod · 0.95
lengthMethod · 0.95

Tested by

no test coverage detected