Exemple #1
0
 /**
  * Returns this vector reflected across the given normal. Does not modify this vector or the
  * normal.
  *
  * @param normal Must be normalized
  */
 public Vector reflect(Vector normal) {
   if (normal.sqrMagnitude() != 1)
     throw new IllegalArgumentException("Normal vector must be normalized");
   return this.minus(normal.times(2).times(this.dot(normal)));
 }