Here is a short program which tells how far away the optical horizon is from a point above the surface of the earth. The program can be used for laser or IR transceivers although it assumes that the receiving antenna is at the surface of the earth. It also assumes that the earth is a perfect sphere with no atmosphere. Nevertheless it can give some idea of the line of sight range of signals. This program is very simple. If there is interest, a more complicated and realistic one could be written.
5 REM This program gives the optical horizon in miles when the height above sea level (in feet) is Known.
7 PRINT AT 1,7;"OPTICAL HORIZON"
10 PRINT AT 4,1;"ENTER HEIGHT OF EYE ABOVE"
11 PRINT AT 5,1;"SEA LEVEL IN FEET"
20 INPUT HEIGHT
25 PRINT AT 8,7;"HEIGHT"
30 PRINT AT 10,1;HEIGHT, "";"FEET"
40 LET A=HEIGHT
50 LET B=SQR (A/4*5)
55 PRINT AT 12,7;"HORIZON"
60 PRINT AT 14,1;B,"MILES"
The key to the whole program is in line 50. It is in that line that the serious calculation is done. All the other lines just collect the input data and provide some screen formatting. If you are a beginning programmer you might want to use this program to practice formating commands and to add a bit of error checking to the input statements.