http://www.carbidedepot.com/formulas-trigright.asp
It's an online Trigonometry Calculator. I simply type in to side c the length of track I have and into angle A the required gradient and press calculate. And then side a is the height of the clearance.
Similarity if you want to work out the gradient enter height a and length c and you can work out the gradient.
I'm hopeless with a calculator* so I find this site very useful.
*I only have a maths degree
