If you are traveling along 20mm and going up 3mm, why not just use Pythagoras rule? a squared + b squared = c squared.