summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw26408.pp
blob: e32d939d1712bb5eac9dd5b7bc8d3baca0314a28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{$mode objfpc}
program bugavx64;

uses math;

function EllipseRadialLength(Width, Height:Integer; EccentricAngle : Extended) : Extended;
var
  a, b, R : Extended;
begin
  a := Width div 2;
  b := Height div 2;
  R := Sqr(a)*Sqr(b);
  if R <> 0 then begin // tweak
    R := Sqrt(R / ((Sqr(b)*Sqr(Cos(DegToRad(EccentricAngle/16))))) +
      (Sqr(a)*Sqr(Sin(DegToRad(EccentricAngle/16)))));
  end;
  Result := R;
end;

begin
end.