Ejemplo n.º 1
0
        //--------------------------- Reflect ------------------------------------
        //
        //  given a normalized vector this method reflects the vector it
        //  is operating upon. (like the path of a ball bouncing off a wall)
        //------------------------------------------------------------------------
        public void Reflect(Vector2D norm)
        {
            //this += 2.0 * this.Dot(norm) * norm.GetReverse();

            Vector2D vecTemp = norm.GetReverse() * this.Dot(norm) * 2.0;

            this.X = vecTemp.X;
            this.Y = vecTemp.Y;
        }