FixR

From SCAR Divi Manual
Revision as of 10:28, 1 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function FixR(Radians: Extended): Extended; </source> ===Source=== <source lang="scar"> function FixR(Radians: Extended): Exten...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.26, 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