Well, here's an overview of the calcs involved for you (I'm sure I did this some time back, but can't find it):
Detect which actual plate is hit by the round, velocity, angle, grab relevant numbers for that projectile and plate...
1. Calc T/d
2. Calculate the slope coefficient, based off the T/d ratio and the slope effect of the ogive of the projectile.
3. Adjust the basic armor resistance for high hardness armor plate (where high hardness is applicable).
4. Adjust resistance again based off the difference between the actual plate hardness and the plate the rounds were originally tested against.
5. Check if it is possible the round shatters, based off T/d compared against the theoretical shatter limit of the projectile.
6. Work out the base penetration for the projectile, based off the velocity at impact, round hardness and the theoretical max it can penetrate.
7. Use the angle of incidence between the plate and the round to work out a final armor plate resistance (no it is NOT a simple Cosine rule).
8. Calc penetration/resistance ratio.
9. If the round shattered, adjust that ratio, based on the effectiveness of a shattered round (lightweight rounds that shatter, usually not terribly effective)
10. Now it gets probabilistic: look for the ends of the bell curve - high end, armor is over-matched and penetrates; low end and the armor is under-matched and the projectile fails. Anywhere in between it is a probability, not a certainty. Work out where on the bell curve the attempt is, generate random number and compare...
11. Final check is for a round that fails to penetrate, but doesn't shatter - may still generate spalling off the inside face of the armor plate.