Microsoft.Xna.Framework.Vector2.Reflect C# (CSharp) Method

Reflect() public static method

Determines the reflect vector of the given vector and normal.
public static Reflect ( Vector2 vector, Vector2 normal ) : Vector2
vector Vector2 Source vector.
normal Vector2 Normal of vector.
return Vector2
        public static Vector2 Reflect(Vector2 vector, Vector2 normal)
        {
            float num = vector.X * normal.X + vector.Y * normal.Y;
            Vector2 result;
            result.X = vector.X - 2f * num * normal.X;
            result.Y = vector.Y - 2f * num * normal.Y;
            return result;
        }
        /// <summary>Determines the reflect vector of the given vector and normal.</summary>

Same methods

Vector2::Reflect ( Vector2 &vector, Vector2 &normal, Vector2 &result ) : void