This is a complicated issue. The pellet is dragged constantly downwards by gravity over time. It's pulled directly vertically downwards over the horizontal distance it travels (not the actual distance it travels)
So, if your target is 45 degrees up a tree, and the tree is 40 yards away, then your pellet will only drop over 40 yards, and not the longer distance that your actual target is. (therefore, landing higher than expected)
The complication comes with the different height of your scope, very steep targets (almost vertical) and the close targets being SO close that the pellet doesn't have time to be affected enough to need adjustment.
The mathmaticians will be on this soon, and I'll get a headache trying to follow them!
Good luck and all the best.
Anschutz 2013 MEC1 .22LR
Miroku 3800 12bore