FixR

From SCAR Divi Manual
Jump to: navigation, search

Definition

function FixR(Radians: Extended): Extended;

Source

function FixR(Radians: Extended): Extended;
begin
  Result := FixD(Radians * (180 / Pi)) * (Pi / 180);
end;

Availability

SCAR Divi 3.00 > Current

  • Before SCAR Divi 3.25, this function was broken.

Description

Fixes an angle specified by Radians in radians by adding/subtracting 2π until the value is part of the range [0,2π[.

Example

begin
  WriteLn(FixR(Pi));
  WriteLn(FixR(-Pi));
  WriteLn(FixR(2 * Pi));
  WriteLn(FixR(3 * Pi));
end.

Output:

3,14159265358979
3,14159265358979
0
3,14159265358979

See Also