Combat Mechanics: Damage Equation

If a creature with X Attack and Y Speed hits a creature with Z defense, how much damage is dealt?

How is this damage modified if the resulting strike is a “glancing blow” or “mortal blow”?

Damage = X-Z+0.25*Y

I think damage variation for glancing/mortal varies.