Classic Computer Magazine Archive COMPUTE! ISSUE 55 / DECEMBER 1984 / PAGE 10

Apple Trigonometry

I was planning to do my trigonometry homework on my computer. I have an Apple II+ and wanted to use the functions SIN, TAN, and COS. I had assumed that the number you put into the parentheses was the number of degrees of an angle, but when I tried it this way the result was not the same as the number on my chart. It didn't agree with COS, SIN, or TAN. So I looked up these functions in my user's manual, but they gave some explanation about radians and other things I could not comprehend. Could you please give me an understandable explanation of what these functions do?

Chuck Knakal, Jr.

The trigonometric functions on the Apple II+ as well as most other computers use radians instead of degrees to specify an angle. Most of us are accustomed to measuring angles in degrees, but radians are actually easier to use when performing complex calculations. Radians are based on the mathematical relationship between a circle's diameter and its circumference. Degrees, on the other hand, are arbitrary and as a result are cumbersome to deal with in calculations.

If you prefer to think in terms of degrees instead of radians, the following table will help you translate between the two.

Degrees Radians
0 0
90 π/2
180 π
270 1.5*π
360 2*π

(Where π is approximately 3.1416.)

The following formulas can be used in your program to convert from radians to degrees and vice versa:

Radians = degrees*3.1416/180

Degrees = radians*180/3.1416

Here's a program that will calculate the SIN of any angle specified in degrees:

20 R = D * 3.1416 / 180
30 PRINT "SIN ="; SIN (R)