home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / lente / BAK / INTERMT1.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-06-02  |  1.9 KB  |  64 lines

  1. Program Lente;
  2. {$G+}
  3. Uses Crt;
  4. Const
  5.   Ancho         =             40;
  6.   SizeLente     =    Ancho*Ancho;
  7.   RadioLente    =              18;
  8. Type
  9.     T_Matriz = file of Byte;
  10. Var
  11.   LenteTrans    : Array [1..SizeLente] of Word;
  12.   Matriz : T_Matriz;
  13. Procedure MakeLenteTrans;
  14. Const
  15.   CtePlano  =         9;
  16. Var
  17.   CntDatosX : Integer;
  18.   CntDatosY : Integer;
  19.   Radio     : Integer;
  20.   D,Qz      : Integer;
  21.   Ix,Iy     : Integer;
  22.   Px,Py     :Integer;
  23.   Med       :Integer;
  24.   Aux       :Integer;
  25. Begin
  26.      Med := Ancho div 2;
  27.   For CntDatosY := 0 to Ancho do
  28.     Begin
  29.       For CntDatosX := 0 to Ancho do
  30.         Begin
  31.              Px :=CntDatosX-Med;
  32.              Py :=CntDatosY-Med;
  33.              writeln('Estos son Px: ',Px,' Py: ',Py);
  34.              readln;
  35.           Radio:= Round (Sqrt (Sqr(Px)+Sqr(Py)));
  36.           If Radio>RadioLente
  37.             then Begin
  38.                  Aux := CntDatosX+((CntDatosY)*Ancho);
  39.                  LenteTrans [Aux]:=Aux;
  40.                  End
  41.             else Begin
  42.                  write('Estos son Px: ',Px,' Py: ',Py);
  43.                    D :=Abs(Sqr(CtePlano)-Sqr(Px)-Sqr(Py)+Sqr(RadioLente));
  44.                    Qz:=Round (1+Sqrt(D));
  45.                    Ix:=(CtePlano*Px) div (Qz + CtePlano);
  46.                    Iy:=(CtePlano*Py) div (Qz + CtePlano);
  47.                    Aux :=Med +Ix+((Med +Iy)*Ancho);
  48.                    LenteTrans [ CntDatosX+((CntDatosY)*Ancho)]:=Aux;
  49.                    write(' D = ',D,' ;Qz = ',Qz,' ;Ix= ',Ix,' ;Iy= ',Iy);
  50.                    write(' El indice es : ',Aux);
  51.                    readln;
  52.                  End;
  53.         End;
  54.     End;
  55. End;
  56. BEGIN
  57.       ClrScr;
  58.       WriteLn ('Codigo LearnWare:  L E N T E.');
  59.       WriteLn ('Por Pedro Antón Alonso. aka <rom / Spanish Lords');
  60.       WriteLn;
  61.       WriteLn ('Generando la matriz de transformación ');
  62.   MakeLenteTrans;
  63.  
  64. END.