1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 16:45:53 +00:00
QB64-PE/internal/help/ATN.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

38 lines
1.3 KiB
Plaintext

The {{KW|ATN}} or arctangent function returns the angle in radians of a numerical [[TAN|tangent]] value.
{{PageSyntax}}
:: radian_angle = '''ATN(''tangent!'')'''
{{PageDescription}}
* The [[SINGLE]] or [[DOUBLE]] ''tangent'' value would be equal to the tangent value of an angle. EX: [[TAN]](ATN(1)) = 1
* The return is that tangent value's ''angle'' in radians. To convert from radians to degrees, multiply radians * (180 / &amp;pi;).
* The function return value is between -&amp;pi; / 2 and &amp;pi; / 2.
''Example 1:'' When the [[TAN]]gent value equals 1, the line is drawn at a 45 degree angle(.7853982 radians) where [[SIN]] / [[COS]] = 1.
{{CodeStart}} '' ''
{{Cl|SCREEN}} 12
x = 100 * {{Cl|COS}}({{Cl|ATN}}(1))
y = 100 * {{Cl|SIN}}({{Cl|ATN}}(1))
{{Cl|LINE}} (200, 200)-(200 + x, 200 + y) '' ''
{{CodeEnd}}
''Example 2:'' {{KW|ATN}} can be used to define &amp;pi; in [[SINGLE]] or [[DOUBLE]] precision. The calculation can NOT be used as a [[CONST]]ant.
{{CodeStart}} '' ''
Pi = 4 * {{Cl|ATN}}(1) '{{Cl|SINGLE}} precision
Pi# = 4 * {{Cl|ATN}}(1#) '{{Cl|DOUBLE}} precision
PRINT Pi, Pi# '' ''
{{CodeEnd}}
{{PageSeeAlso}}
* [[TAN]] {{text|(tangent)}}
* [[SIN]], [[COS]]
* [[Mathematical Operations]]
* [[Mathematical_Operations#Derived_Mathematical_Functions|Derived Mathematical Functions]]
{{PageNavigation}}