1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00
QB64-PE/internal/help/_ATAN2__11112.txt
Roland Heyder aeb9c0668b Updates help files for use with new Wiki parser (2nd try)
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
2022-05-21 00:18:31 +02:00

42 lines
1.5 KiB
Plaintext

{{QBDLDATE:05-20-2022}}
{{QBDLTIME:23:06:30}}
{{DISPLAYTITLE:_ATAN2}}
The [[_ATAN2]] function returns the radian angle between the positive x-axis of a plane and the point given by the coordinates (x, y).
{{PageSyntax}}
: {{Parameter|angle!}} = [[_ATAN2]]({{Parameter|y}}, {{Parameter|x}})
{{Parameters}}
* {{Parameter|y}} is the vertical axis position (row) as a positive, zero or negative floating point value.
* {{Parameter|x}} is the horizontal axis position (column) as a positive, zero or negative floating point value.
{{PageDescription}}
* The [[DOUBLE]] radian angle returned is '''positive''' for upper row values where y > 0.
::* _ATAN2(y, x) = [[ATN]](y# / x#) when x > 0
::* _ATAN2(y, x) = [[ATN]](y# / x#) + [[_PI]] when x < 0
::* _ATAN2(y, x) = [[_PI]] / 2 when x = 0
* The [[DOUBLE]] radian angle returned is 0 when x > 0 and [[_PI]] when x < 0 where y = 0
* The [[DOUBLE]] radian angle returned is '''negative''' for lower row values where y < 0.
::* _ATAN2(y, x) = [[ATN]](y# / x#) when x > 0
::* _ATAN2(y, x) = [[ATN]](y# / x#) - [[_PI]] when x < 0
::* _ATAN2(y, x) = -[[_PI]] / 2 when x = 0
* _ATAN2(0, 0) is undefined and the function returns 0 instead of a division error.
{{PageErrors}}
* With [[ATN]](y / x), x can never be 0 as that would create a Division by Zero [[ERROR Codes|error]] 11 or #IND.
{{PageSeeAlso}}
* [[ATN]] {{text|(arctangent)}}
* [[_PI]] {{text|(QB64 function)}}
* [[Mathematical Operations]]
* [https://en.wikipedia.org/wiki/Atan2 Atan2 reference]
{{PageNavigation}}