tan Example
10! This example deminstrates the usage of the trigonometric
20! functions. The following triangle will be used:
30!
40! |\
50! |a \ Given C = 5 units and angle c = 35 degrees
60! C| \B
70! |b c\ Note: angle b = 90 dgrees.
80! +--------
90! A
100 CLEAR SCREEN
110 DEG ! get in degree mode
120 REAL A,B,C
130! Given:
140 C=4
150 Angle_c=60
160 Angle_b=90
170! Angle a can be found by simply subtracting the total given
180! angles by 180 degrees. Every triangle only has 180
190! degress.
200 Angle_a=180-(Angle_c+Angle_b)
210! The sine of angle c is definded as C over B. Solving for
220! B gives us:
230 B=C/SIN(Angle_c)
240! The tangent of angle c is definded as C over A. Solving for
250! A gives us:
260 A=C/TAN(Angle_c)
270! To double check the answers, one possible way is:
280! Given: A^2 + C^2 = B^2 and solving for C
290 IF SQR(B^2-A^2)=C THEN
300 PRINT "The leg A =";A;"units."
310 PRINT "The leg B =";B;"units."
320 PRINT "The leg C =";C;"units."
330 PRINT "Angle a is = ";Angle_a;"degrees."
340 PRINT "Angle b is = ";Angle_b;"degrees."
350 PRINT "Angle c is = ";Angle_c;"degrees."
360 ELSE
370 PRINT "An error has occured."
380 END IF
390 END