1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-20 20:55:13 +00:00
qb64/internal/help/ATN.txt
Luke Ceddia b586eafd3b Integrated _BLINEINPUT into regular LINE INPUT for BINARY files
LINE INPUT will now use the faster method if passed a file handle
that has been opened FOR BINARY. As such, the _BLINEINPUT command
has been removed.

qb64.bas now takes advantage of this for reading from '$include files,
at least in Include Manager 1. Some tweaking of internal/source/main.txt
was required to get things into a sane state, so I'm holing off changing
the compiler any further so the auto-builder can make sure everything's
smoothed over.

Note: Everything should still compile as normal; I'm just being overcautious.
2014-07-27 00:06:17 +10: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 / π).
* The function return value is between -π / 2 and π / 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 π 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}}