esercizi di fisicacon turbo pascal 1.1 su mac

 

(* conca1.fis immagini specchi concavi *)
program concavi;
var dsorgente,dimmagine,altezzai,ingrandimento:real;
    altezzas,fuoco:integer;
    contatore:integer;
    b:string;
begin
 clearscreen;
 writeln('legge punti coniugati per specchi concavi e lenti convesse');
 writeln('notare segmo + - per distanza,altezza immagine ');
 writeln;
 b:='------------------------------------------------------';
 fuoco:=40;
 dsorgente:=120;
 altezzas:=50;
 for contatore:=1 to 11 do
  begin
  if dsorgente=70 then writeln(b);
  if dsorgente=fuoco then
  begin
  dsorgente:=dsorgente-10;
  writeln('sorgente su fuoco=',fuoco,'..immagine a infinito');
  writeln(b);
  end;
  dimmagine:=fuoco*dsorgente/(dsorgente-fuoco);
  ingrandimento:=dimmagine/dsorgente;
  altezzai:= ingrandimento*altezzas;
  write('dsorgente=',dsorgente:3:0,'...dimmagine=',dimmagine:3:0);
  write('..ingrandimento=',ingrandimento:3:1);
  writeln('..altezzas=',altezzas,'..altezzai=',altezzai:3:0);
  dsorgente:=dsorgente-10;
  end;
  writeln('premi enter per finire');
  readln;
end.