MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / angle

Method angle

src/main/java/field/linalg/Vec3.java:1205–1211  ·  view source on GitHub ↗

Return the angle between this vector and the supplied vector. @param v the other vector @return the angle, in radians @see #angleCos(Vec3)

(Vec3 v)

Source from the content-addressed store, hash-verified

1203 * @see #angleCos(Vec3)
1204 */
1205 public double angle(Vec3 v) {
1206 double cos = angleCos(v);
1207 // This is because sometimes cos goes above 1 or below -1 because of lost precision
1208 cos = Math.min(cos, 1);
1209 cos = Math.max(cos, -1);
1210 return Math.acos(cos);
1211 }
1212
1213 /**
1214 * Set all components to zero.

Callers

nothing calls this directly

Calls 4

angleCosMethod · 0.95
acosMethod · 0.80
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected