Are you familiar with the Pythagorean Theorem?
Put it simply, In a right angle triangle with sides a,b, and c, where c is the diagonal line (called the hypotenuse), a and b are the other two lines in the triangle that make a right angle.
For your question, you have a vertical height and a horizontal height, which makes a right angle. The plane flew diagonally, so the path it traveled is the hypotenuse.
It doesn't matter what order you put it in, but the distances 1500m and 12km are your values for a and b.
Remember to convert 1500 into 1.5km first. H