A method for calculating a flight path avoiding a collision with the
ground when an aircraft dives towards the ground. The method includes
receiving signals including information of a dive angle of the aircraft
in relation to the imaginary ground plane, and a present roll angle of
the aircraft, and calculating a flight path that avoids collision with
the ground on the basis of the information. The calculation includes
calculating a need for rolling the aircraft based on the present roll
angle, and calculating a need for changing the direction of the velocity
vector of the aircraft so that the change has a component in an upward
direction in relation to the reference frame of the aircraft. The
calculation of the need for rolling the aircraft is also based on the
dive angle so that the calculated flight path turns sideways when the
dive angle surpasses a specified dive angle and when the present roll
angle is larger than zero degrees, and so that the flight path continues
in a forward direction when the dive angle is below the specified dive
angle. The invention also relates to a ground collision calculating unit,
a computer program, and a computer readable medium.