The rules for aircraft performance are extensive, I once did a two week course on this and it was not a page turner!
Essentially, each takeoff is planned so that you can lose an engine at the most critical point of the takeoff and then miss all obstacles in the departure lane by 35 feet. (for those in the know, I appreciate this is very basic) So the runway length, slope, wind, mass of the aircraft, temperature, pressure, elevation of the airfield, and placing of the obstacles makes a big difference. The rules are such that the climb gradient achieved with an engine out can always be achieved, the mandated gradient is dependent on the number of engines fitted, it is in the region of 2.7/2.4%
For landing, calculations are also made, but they are less demanding as the aircraft already has a lot more energy than if it were accelerating on the take off. The rules on the gradient changed with EASA an a Missed Approach Climb Gradient of 2.5% was required, this is no longer mandated for UK registered aircraft but it is fairly normal to adhere to it anyway.
These gradients are not really shown in the flight deck but we fly to speeds, which will ensure the gradients are met for the mass of the aircraft at that time.
It is also worth noting that gradient is not the same as body angle, on take off the body angle can be quite high, but this does not mean a greater gradient