1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 11:40:38 +00:00
QB64-PE/internal/help/_PI.txt
SteveMcNeill 33adc04fc4 Add temp folder to repo. It's necessary as well!
Just more initial setting on... nothing much to see here.
2022-04-28 13:39:56 -04:00

37 lines
960 B
Plaintext

{{DISPLAYTITLE: _PI}}
The [[_PI]] function returns '''π''' as a [[_FLOAT]] value with an optional multiplier parameter.
{{PageSyntax}}
: {{Parameter|circumference}} = [[_PI]][({{Parameter|multiplier}})]
{{Parameters}}
* Optional {{Parameter|multiplier}} (''2 * radius'' in above syntax) allows multiplication of the π value.
{{PageDescription}}
* Function can be used in to supply π or multiples in a program.
* Accuracy is determined by the return variable type [[AS]] [[SINGLE]], [[DOUBLE]] or [[_FLOAT]].
* The π value can also be derived using 4 * [[ATN]](1) for a [[SINGLE]] value.
{{PageExamples}}
''Example:'' Calculating the area of a circle using a [[SINGLE]] variable in this case.
{{CodeStart}}radius = 5
circlearea = {{Cl|_PI}}(radius ^ 2)
PRINT circlearea
{{CodeEnd}}
{{OutputStart}} 78.53982
{{OutputEnd}}
{{PageSeeAlso}}
* [[_ATAN2]], [[TAN]]
* [[ATN]] {{text|(arctangent)}}
* [[SIN]], [[COS]]
{{PageNavigation}}
<