Finding New Velocities after Reflection

Alright, so I have Velocities x y and z reflecting off of a flat surface. It is a perfect reflection (no velocity is lost). I have 3 points on the flat surface (each with x,y,z.. a triangle) which i took the Normal angle of using the vector of the 3 points.

There's really two parts to this problem, solving for the new Vxy and solving for the new Vz.

**Found Variables:**

**fx, fy, fz** (Normal vector from the surface of the triangle)

**d** = pythagorean using fx and fy

**Vt** (Velocity of the particle)

**Vx, Vy, Vz** (Initial velocities of the particle)

**AngleXY = Atan(fy/fx)** (XY Angle of the normal vector = XY Normal Angle)

**AngleZ = Atan(fz/d)** (Z Angle of the normal vector = Z Normal Angle)

**VelAngleXY** (XY Angle of the intial Velocities, found through atan)

**VelAngleZ** (Z Angle of the initial Velocities, found through atan)

**My Attempt:**

**Solving for Vx, Vy**

FinalAngleXY = (-XYAngle)-(VelAngleXY+AngleXY)

Vd = Pythag using Vt and Vz to find adjacent component

FinalVx = Vd*Cos(FinalAngleXY)

FinalVy = Vd*Sin(FinalAngleXY)

**Solving for Vz**

FinalAngleZ = -AngleZ-(VelAngleZ+AngleZ)

FinalVz = Vt*Sin(FinalAngleZ)

**What I found:**

When the particle hits a slope, no matter the slopes direction it will reverse the particle's direction. Example: You throw a ball down a hill, it bounces back up instead of down (mainly due to the new XY velocities, but the new Z velocity is off too)

Any help is much appreciated! Been stuck on this for awhile now