// copyright (c) 1997-2018 Martin Wynne. All rights reserved. function aq25offset(xs:extended; var k:extended):extended; // return offset at xs on turnout road centre-line. // also return the angle in k. var temp:extended; x,xlim,rto:extended; curve_endx:extended; //////////////////////////////////////////////////////////// procedure do_gaunt; begin RESULT:=g/2+h; k:=0; end; //////////////////////////////////////////////////////////// procedure do_parallel_xing; begin if xsretrorgx then begin RESULT:=trtscent+g/2; // parallel section beyond return curve. k:=0; EXIT; end; if retr(torgx+xlim) then begin x:=xlim; // forward limit x from rad centre. BREAK; end; if xs<(torgx-xlim) then begin x:=0-xlim; // backward limit x from rad centre. BREAK; end; x:=xs-torgx; // ok, x from rad centre. BREAK; until 0<>0; try temp:=SQR(rto)-SQR(x); RESULT:=torgy-SQRT(temp)*SGZ(rto); // calc turnout curve. k:=ARCSIN(x/rto); // and gradient angle. except abandon_calcs:=True; // abandon ship. Cannot be if x is under 90 degrees ? RESULT:=0; k:=0; end;//try end; //////////////////////////////////////////////////////////// procedure do_regular_beyond_curve_end; begin if xs(xorg+min_turnout_road_endx) then xe:=xorg+turnout_road_endx // 2=adjustable turnout road 3 added 217a else xe:=turnoutx; else xe:=turnoutx; // ??? end;//case if (turnout_road_i<2) and (xe>turnoutx) then xe:=turnoutx; // 209a was <>2 217a if xs>(xe-minfp) then EXIT; // !!! 0.76.a 18-1-2002 repeat if xs>xe then xs:=xe; // ensure we hit the end ys:=aq25offset(xs,dummy); // get offset to centre-line (angle not used) if (f28000(25,xs,ys)=1) or (xs>=xe) then BREAK; // do curving on xs,ys and put in array (aq=25) xs:=xs+incx; // increment xs. until 0<>0; end; //______________________________________________________________________________