Trigonometric functions: Difference between revisions

→‎{{header|BASIC}}: Changed the arc functions to print the answer in degrees and radians rather than use two different angles.
(Added BASIC example.)
(→‎{{header|BASIC}}: Changed the arc functions to print the answer in degrees and radians rather than use two different angles.)
Line 73:
PRINT TAN(radians) + " " + TAN (degrees) 'tangent
'arcsin
PRINTarcsin = 2 * ATN * radians / (1 + SQR(1 - radians ^ 2)) + " " + 2 * ATN * (degrees * pi / 180) / (1 + SQR(1 - (degrees * pi / 180) ^ 2))
PRINT arcsin + " " + arcsin * 180 / pi
'arccos
PRINTarccos = 2 * ATN * SQR(1 - radians ^ 2) / (1 + radians) + " " + 2 * ATN * SQR(1 - (degrees * pi / 180) ^ 2) / (1 + (degrees * pi / 180))
PRINT ATN(radians)arccos + " " + ATNarccos (degrees)* 'arctan180 / pi
PRINT ATN(radians) + " " + ATN (radians) * 180 / pi 'arctan
 
=={{header|Forth}}==
Anonymous user