Function to obtain the value of Pi.

 

Syntax

function Pi: extended;

 

Function result

Returns  the mathematical value of pi, the ratio of a circle's circumference to its diameter.

 

Example

const
  iDiameter = 10; // 10 centimeters
begin
  mLogScript('The diameter of the circle = ' + inttostr(iDiameter), '');
  mLogScript('The area of the circle = ' + floattostr(Pi * iDiameter), '');
  mLogScript('Circumference = ' + floattostr(Pi * (iDiameter / 2) * (iDiameter / 2)), '');
end.

Script work result

[08:24:58] (Log "Pi"): The diameter of the circle = 10

[08:24:58] (Log "Pi"): The area of the circle = 31.415926535898

[08:24:58] (Log "Pi"): Circumference = 78.539816339745
 

See also

FloatToStr
mLogScript