code 34344;
procedure CARPOL(AR,AI,R,C,S);
value AR,AI; real AR,AI,R,C,S;
if AR=0&AI=0 then
begin C:=1;R:=S:=0 end
else begin
R:=if ABS(AR)>ABS(AI) then
ABS(AR)*SQRT(1+(AI/AR)**2)
else ABS(AI)* SQRT(1+(AR/AI)**2);
C:=AR/R;S:=AI/R
end CARPOL;
eop