title: How to find the vector of reflection of a ray from a plane?
body: <p>I have a vector that falls on a plane. I know that she exactly falls on the plane and I know the point of the fall. I need to find a reflection vector.</p>
  
  <p>The plane is represented by 3 points on it.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>    public static Vector3 GetReflectedVector(Vector3 direction,Vector3 vert0, Vector3 vert1, Vector3 vert2)
      {
          Vector3 normalizeDirection = Normalize(direction);
  
          Vector3 planeNormal = Normalize(Cross(vert1 - vert0, vert0 - vert2));
  
          double dot = Dot(normalizeDirection, planeNormal);
  
          double mod = VectorModule(planeNormal);
  
          double pr = dot / mod;
  
          Vector3 projection = planeNormal * (float)pr * 2f;
  
          return direction - projection;
      }
  </code></pre>
  
  <p>Here such logic (should be):</p>
  
  <ol>
  <li>obtain a normal to the plane {vert0, vert1, vert2};</li>
  <li>obtain the projection of direction on the normal</li>
  <li>double the resulting vector</li>
  <li>subtract the received from the source vector dir.</li>
  </ol>