42 lines
1.7 KiB
Plaintext
42 lines
1.7 KiB
Plaintext
MODE 15 REM Suitable sized output window so that all output fits neatly
|
|
DEF FNMod(a, b) WHILE a >= b a-=b ENDWHILE =a REM Floating point mod
|
|
|
|
DEF FNd2d(a) = FNMod(a, 360)
|
|
DEF FNg2g(a) = FNMod(a, 400)
|
|
DEF FNm2m(a) = FNMod(a, 6400)
|
|
DEF FNr2r(a) = FNMod(a, 2 * PI)
|
|
|
|
DEF FNd2g(a) = FNd2d(a) * 10 / 9
|
|
DEF FNd2m(a) = FNd2d(a) * 160 / 9
|
|
DEF FNd2r(a) = RAD(FNd2d(a))
|
|
|
|
DEF FNg2d(a) = FNg2g(a) * 9 / 10
|
|
DEF FNg2m(a) = FNg2g(a) * 16
|
|
DEF FNg2r(a) = FNg2g(a) * PI / 200
|
|
|
|
DEF FNm2d(a) = FNm2m(a) * 9 / 160
|
|
DEF FNm2g(a) = FNm2m(a) / 16
|
|
DEF FNm2r(a) = FNm2m(a) * PI / 3200
|
|
|
|
DEF FNr2d(a) = DEG(FNr2r(a))
|
|
DEF FNr2g(a) = FNr2r(a) * 200 / PI
|
|
DEF FNr2m(a) = FNr2r(a) * 3200 / PI
|
|
|
|
@%=&02070F
|
|
Dash75$=STRING$(75, "-")
|
|
|
|
PRINT TAB(0, 0) " Degrees Normalized Gradians Mils Radians"'Dash75$
|
|
PRINT TAB(0, 15) " Gradians Normalized Degrees Mils Radians"'Dash75$
|
|
PRINT TAB(0, 30) " Mils Normalized Degrees Gradians Radians"'Dash75$
|
|
PRINT TAB(0, 45) " Radians Normalized Degrees Gradians Mils "'Dash75$
|
|
|
|
FOR I%=1 TO 12
|
|
READ Angle
|
|
PRINT TAB(0, 1+I%) Angle, FNd2d(Angle), FNd2g(Angle), FNd2m(Angle), FNd2r(Angle)
|
|
PRINT TAB(0, 16+I%) Angle, FNg2g(Angle), FNg2d(Angle), FNg2m(Angle), FNg2r(Angle)
|
|
PRINT TAB(0, 31+I%) Angle, FNm2m(Angle), FNm2d(Angle), FNm2g(Angle), FNm2r(Angle)
|
|
PRINT TAB(0, 46+I%) Angle, FNr2r(Angle), FNr2d(Angle), FNr2g(Angle), FNr2m(Angle)
|
|
NEXT
|
|
|
|
DATA -2, -1, 0, 1, 2, 6.2831853, 16, 57.2957795, 359, 399, 6399, 1000000
|