CHAPTER3

Earth Trigonometry

The Earth

The Earth is almost spherical. But it is slightly squashed at the north and south poles. The equator has a radius of 6378 kilometres; the polar radius is 6357 kilometres. The difference is only about 0.3% and you can hardly tell that it isn't a sphere. The average radius is 6371 kilometres.
   We are used to saying that the shortest distance between two points is a 'straight line'. But this applies only on a plane, or on any 'flat' surface. On a sphere, like the Earth, the shortest distance between two points is part of a circle called a great circle. A great circle is a circle whose centre is the centre of the earth.
   Great circles passing through the north and south poles are called lines of longitude. Lines of longitude have an angle associated with them: the line of longitude that passes through Greenwich, England, is marked 0° (0 degrees). The others are marked by measuring the angle at the centre of the Earth between the line of longitude and the one at Greenwich -- see Figure 13. Usually longitude lines go from 0° or 180° both east and west.
   Lines of longitude tell us how far a point on the Earth is east or west of Greenwich. To show how far a point is north or south of the equator we use lines of latitude. The equator is said to be of latitude 0°. Circles on the Earth which are parallel to the equator are called lines of latitude. The angle (measured at the centre of the Earth) between the equator and a line of latitude is called the latitude -- see Figure 14.
   Latitudes go from 0° to 90° both north and south. The north pole is at latitude 90°, while the south pole is at 90° south.
   Any point on the Earth may be pin-pointed by its latitude and longitude. For instance, Newcastle upon Tyne (England) is at latitude 55° north and 1.5° west approximately. More accurate values are 55° 58' N and 1° 36' W, where the symbol ' is read as minutes and a minute is 1/60 of a degree.
   Latitudes and longitudes are a set of coordinates on the surface of the Earth.
   Calculating the (shortest, great circle) distance between two points on the Earth is not easy. For instance, what is the distance between Newcastle upon Tyne and Paris, France? (Paris is at approximately 49° N, 2° E.) With a suitable program on your micro this presents no problems.

Figure 13.

   The next program calculates distances between two points on the Earth's surface. The mathematics behind the program is based on several uses of the cosine and sine rules discussed in the previous chapter.

Listing 3.1
LIST

   10 REM Earth Trigonometry
   20 MODE 1:COLOUR 3:PRINT ' TAB(11);"E
arth trigonometry"'
   30 PRINT "This program calculates the
 shortest"
   40 PRINT "distance between two points
 on the Earth "
   50 REM Input data
   60 DIM A(2),B(2):@%=10
   70 FOR I=1 TO 2
   80  COLOUR 2:PRINT '"Position ";I:COL
OUR 1
   90  REPEAT
  100   INPUT " Latitude ";A(I)
  110   IF A(I)<0 OR A(I)>90 THEN COLOUR
 3:PRINT "Between 0 and 90!"':COLOUR 1
  120  UNTIL A(I)>=0 AND A(I)<=90
  130  REPEAT
  140   INPUT "  N or S ";A$
  150   IF A$<>"N" AND A$<>"S" THEN COLO
UR 3:PRINT "North or south!"':COLOUR 1
  160  UNTIL A$="N" OR A$="S"
  170  PRINT:IF A$="S" THEN A(I)=-A(I)
  180  REPEAT
  190   INPUT "Longitude ";B(I)
  200   IF B(I)<0 OR B(I)>180 THEN COLOU
R 3:PRINT "Between 0 and 180!"':COLOUR 1
  210  UNTIL B(I)>=0 AND B(I)<=180
  220  REPEAT
  230   INPUT "   E or W ";A$
  240   IF A$<>"E" AND A$<>"W" THEN COLO
UR 3:PRINT "East or West!"':COLOUR 1
  250  UNTIL A$="E" OR A$="W"
  260  IF A$="E" THEN B(I)=-B(I)
  270 NEXT
  280 PRINT:PRINT "Do you want the dista
nce in Miles or    kilometres?"
  290 REPEAT
  300  INPUT "M or K ";A$
  310  IF A$<>"M" AND A$<>"K" THEN COLOU
R 3:PRIN "M or K"':COLOUR 1
  320 UNTIL A$="M" OR A$="K"
  330 R=6371:B$=" Kilometres":IF A$="M" 
THEN R=2960:B$=" Miles"
  340 REM The calculation
  350 A1=RAD(A(1)):A2=RAD(A(2)):B1=RAD(B
(1)):B2=RAD(B(2))
  360 B=ABS(B(1)-B(2)):IF B>180 THEN B=1
80-B
  370 A=RAD(ABS(A(1)-A(2)))/2:B=RAD(B)/2
  380 X=COS(A1)*SIN(B)*COS(A2)*SIN(B) + 
SIN(A)*SIN(A)
  390 D=2*R*ASN(SQR(X))
  400 COLOUR 1:@%=&02020A:PRINT '"The di
stance is ";D;B$
  410  COLOUR 3:PRINT ' CHR$(7) TAB(10);
"Another go? Y or N ";
  420 REPEAT:G$=GET$:UNTIL G$="Y" OR G$=
"N"
  430 IF G$="Y" THEN RUN
  440 CLS:PRINT '"Bye for now.":END


RUN

           Earth trigonometry

This program calculates the shortest
distance between two points on the Earth
 

Position 1
Latitude ?54.9
  N or S ?N

Longitude ?1.5
   E or W ?W

Position 2
 Latitude ?51.5
  N or S ?N

Longitude ?0
   E or W ?W

Do you want the distance in Miles or    
kilometres?
M or K ?M

The distance is 181.67 Miles

         Another go? Y or N 


Figure 14.