
There are three methods of measuring angles: degrees, grads, and radians. However, the ZX81 with all its new trigonometric functions can only measure angles in radians. You can convert a measurement by any of the three methods to either of the remaining methods with the few short programs given in the listings below. You may want to add a REM statement to identify each listing for use in a program.
Type in the program you need. Hit RUN and ENTER. One prompt will appear on the screen, e.g., in Listing 1, RADIANS=. Type in the number of radians you want converted to degrees and press ENTER. The answer will appear.
Listing 1: Radians to Degrees.
10 PRINT "RADIANS=";
20 INPUT R
30 PRINT R
40 LET D=R*180/PI
50 PRINT "DEGREES=";D
60 STOP
Listing 2: Degrees to Radians.
10 PRINT "DEGREES=";
20 INPUT D
30 PRINT D
40 LET R=PI*D/180
50 PRINT "RADIANS=";R
60 STOP
Listing 3: Radians to Grads.
10 PRINT "RADIANS=";
20 INPUT R
30 PRINT R
40 LET G=63.661977*R
50 PRINT "GRADS=";G
60 STOP
Listing 4: Grads to Radians.
10 PRINT "GRADS=";
20 INPUT G
30 PRINT G
40 LET R=G/63.661977
50 PRINT "RADIANS=";R
60 STOP
Listing 5: Degrees to Grads.
10 PRINT "DEGREES=";
20 INPUT D
30 PRINT D
40 LET G=D/.9
50 PRINT "GRADS=";G
60 STOP
Listing 6: Grads to Degrees.
10 PRINT "GRADS=";
20 INPUT G
30 PRINT G
40 LET D=G*.9
50 PRINT "DEGREES=";D
60 STOP
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.