Difference between revisions of "Pi"

From Lazarus wiki
Jump to navigationJump to search
(language)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Pi}}
 
{{Pi}}
  
Pi is the ratio of the circumference of a circle to its diameter.
+
π (greek letter pi) is the ratio of the circumference of a circle to its diameter.
Pi is about 3.14159265358979. A full circle has 2*Pi [[Radian|radians]].
+
π is about <syntaxhighlight lang="pascal" inline>3.14159265358979</syntaxhighlight>.
In [[Pascal]], Pi is a [[Function|function]] which returns the value of pi.
+
A full circle has <syntaxhighlight lang="pascal" inline>2*pi()</syntaxhighlight> [[Radian|radians]].
  
Pi/4 is the same as arctan(1).
+
In [[Free Pascal|Free Pascal's]] [[RTL]], <syntaxhighlight lang="pascal" inline>system.pi</syntaxhighlight> is a [[Function|<syntaxhighlight lang="pascal" inline>function</syntaxhighlight>]] which returns the value of π.
 +
This allows you to assign <syntaxhighlight lang="pascal" inline>addr(system.pi)</syntaxhighlight> to a procedural variable.
 +
 
 +
<syntaxhighlight lang="pascal" inline>pi()/4</syntaxhighlight> is the same as <syntaxhighlight lang="pascal" inline>arctan(1)</syntaxhighlight>.
  
  
 
== See also ==
 
== See also ==
* [[doc:rtl/system/pi.html|Pi]]
+
* {{Doc|package=RTL|unit=system|identifier=pi|text=<syntaxhighlight lang="pascal" inline>system.pi</syntaxhighlight>}}
* [[doc:rtl/system/arctan.html|ArcTan]] Calculate arctangent.
+
* {{Doc|package=RTL|unit=system|identifier=arctan|text=<syntaxhighlight lang="pascal" inline>system.arctan</syntaxhighlight>}} calculates arc tangent.
 
 
[[Category:Constants]]
 

Latest revision as of 17:14, 6 August 2022

Deutsch (de) English (en) suomi (fi) français (fr) русский (ru) 中文(中国大陆)‎ (zh_CN)

π (greek letter pi) is the ratio of the circumference of a circle to its diameter. π is about 3.14159265358979. A full circle has 2*pi() radians.

In Free Pascal's RTL, system.pi is a function which returns the value of π. This allows you to assign addr(system.pi) to a procedural variable.

pi()/4 is the same as arctan(1).


See also