program Ponyhof;
var
  i, j : integer;
  P1,P2,P3: integer;

  Lat,Lon: real;
  Lat1,Lon1: real;
  Lat2,Lon2: real;
  Lat3,Lon3: real;
  utmX: integer;
  utmY: Char;
  utmE: real;
  utmN: real;
begin
   P1:=1;
   P2:=4;
   P3:=1;
 
(* Was findet ihr an Stage 2? *)
   if P1=1 then begin (* 1a) Möbiusband *)
      utmX:=32;
      utmY:="U";
      utmE:=461810;
      utmN:=5502083;

      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat1,Lon1);
      writeln('P1: ',WGS84(Lat1,Lon1))
   end;

   if P1=2 then begin (* 1b) Polybios-Quadrat *)
      utmX:=32;
      utmY:="U";
      utmE:=459166; 
      utmN:=5496230;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat1,Lon1);
      writeln('P1: ',WGS84(Lat1,Lon1))
   end;

   if P1=2 then begin (* 1c) Pascal'sches Dreieck *)
      utmX:=32;
      utmY:="U";
      utmE:=470934;
      utmN:=5495455;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat1,Lon1);
      writeln('P1: ',WGS84(Lat1,Lon1))
   end;

(* Welche Chiffre wird nicht verwendet? *)
   if P2=1 then begin (* 2a) Vigenère  *)
      utmX:=32;
      utmY:="U";
      utmE:=468062;
      utmN:=5501164;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat2,Lon2);
      writeln('P2: ',WGS84(Lat2,Lon2))
   end;

   if P2=2 then begin (* 2b) Playfair *)
      utmX:=32;
      utmY:="U";
      utmE:=468114;
      utmN:=5487827;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat2,Lon2);
      writeln('P2: ',WGS84(Lat2,Lon2))
   end;

   if P2=3 then begin (* 2c) ADFGVX *)
      utmX:=32;
      utmY:="U";
      utmE:=470075;
      utmN:=5512338;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat2,Lon2);
      writeln('P2: ',WGS84(Lat2,Lon2))
   end;

   if P2=4 then begin (* 2d) Gartenzaun *)
      utmX:=32;
      utmY:="U";
      utmE:=488070;
      utmN:=5496838;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat2,Lon2);
      writeln('P2: ',WGS84(Lat2,Lon2))
   end;

(* Welches Gerät war bis vor kurzem nur bedingt zum Abseilen zugelasen? *)
   if P3=1 then begin (* 3a) Achter *)
      utmX:=32;
      utmY:="U";
      utmE:=457370;
      utmN:=5484358;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat3,Lon3);
      writeln('P3: ',WGS84(Lat3,Lon3))
   end;

   if P3=2 then begin (* 3b) Tuba *)
      utmX:=32;
      utmY:="U";
      utmE:=464586;
      utmN:=5497790;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat3,Lon3);
      writeln('P3: ',WGS84(Lat3,Lon3))
   end;

   if P3=3 then begin (* 3c) Rack *)
      utmX:=32;
      utmY:="U";
      utmE:=487704;
      utmN:=5512419;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat3,Lon3);
      writeln('P3: ',WGS84(Lat3,Lon3))
   end;
         
   if P3=4 then begin (* 3d) Eddy *)
      utmX:=32;
      utmY:="U";
      utmE:=480640;
      utmN:=5496976;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat3,Lon3);
      writeln('P3: ',WGS84(Lat3,Lon3))
   end;

   if P3=5 then begin (* 3e) GriGri *)
      utmX:=32;
      utmY:="U";
      utmE:=487539;
      utmN:=5483656;
      UTMtoWGS84(utmX,utmY,utmE,utmN, Lat3,Lon3);
      writeln('P3: ',WGS84(Lat3,Lon3))
   end;

  circumcircle(Lat1,lon1,lat2,lon2,lat3,lon3,lat,lon);
  writeln('C : ',WGS84(Lat,Lon));
  
  WptsClear;
  WptsAdd(Lat1,Lon1);
  WptsAdd(Lat2,Lon2);
  WptsAdd(Lat3,Lon3);
  WptsAdd(Lat,Lon);
  
  if IsPocketPC then begin
     WptsSaveOzi('KDB')
  end
  else begin
     WptsSaveGGPX('KDB') 
(*     WptsTransfereOzi *)
  end;
end.