Estimating distance to horizon

Assume that you are sitting at the beach enjoying the lovely weather we had this summer... You look eastwards and see a ship heading out to sea. The purpose of this exercise is to estimate the distance to the ship just as it disappears below the horizon. For the purposes of this exercise, assume that your eyes are 1 metre above the ground when sitting and that the radius of the earth is 6000 km.

Write a MATLAB program (as a script file) that calculates and prints out the distance to the ship. All constants should be declared as parameter variables.

There is a hint available if you need help on solving this problem.

The theoretical answer is 3464 m.