Source code of 6.1.4 - Flow of trigonometric functions

 Back  Programming  Next


10 CLS                 ' Command to clear the screen
11 CLEAR               ' Command to delete the contents of all variables
12 DEFINT I-K, M-N, Z
14 DEFSNG A-D
15 DEFDBL X-Y
17 CONST CPI = 3.1415927#
20 REM Than this number further starts the program code
30 y = CPI / 6
40 k = 1
45 PRINT "angle°", "sin", "cos", "tan", "cntag"
50 a = SIN(y * k)
60 b = COS(y * k)
70 c = TAN(y * k)
80 d = 1 / c
150 z = 30 * k
200 k = k + 1
250 PRINT z, a, b, c, d
300 IF k < 13 THEN GOTO 50
900 SLEEP
999 END                ' Completion of the programming code
1000 REM Than this number further start sub-programs

This program has no entry for the query, using known mathematical methods to calculate and display the values of the trigonometric functions.

Why are the known values of 90, 180, 270 and 360 degrees is not calculated as a value in the table? What would happen to the execution of line 80 when the variable 'k' having an initial value of 0 instead of 1?

Does it make sense variables a, b, c and d are declared to be an integer?

Expand the program in such a way that the results are displayed with four digits, for example, to retrofitting line 50 in

a = INT(SIN(y * k) * 1000) / 1000.

What's up with that basically made?

 Back
 Search
 Next

 Content - Home
 Content  Informatics Alphabet
 
Citing this page:
Radic, Drago. " IT - Informatics Alphabet " Split-Croatia.
{Date of access}. <http://www.informatics.buzdo.com/>.
Copyright © by Drago Radic. All rights reserved. | Disclaimer