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

Method reflect

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

Reflect this vector about the given normal vector. @param normal the vector to reflect about @return this

(Vec3 normal)

Source from the content-addressed store, hash-verified

1307 * @return this
1308 */
1309 public Vec3 reflect(Vec3 normal) {
1310 double dot = this.dot(normal);
1311 x = x - 2.0 * dot * normal.x;
1312 y = y - 2.0 * dot * normal.y;
1313 z = z - 2.0 * dot * normal.z;
1314 return this;
1315 }
1316
1317 /**
1318 * Reflect this vector about the given normal vector.

Callers

nothing calls this directly

Calls 1

dotMethod · 0.95

Tested by

no test coverage detected