home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
printer
/
laser.arc
/
SINC.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-03-27
|
694b
|
27 lines
Program Sine;
{This program creates a sample file for the plotting programs.}
Var
File_var: Text;
I: Integer;
J: Integer;
Scale: Real;
Sine_point: Real;
Begin
Assign(File_var, 'Sinc.dat');
Rewrite(File_var);
Scale := 2.0 * pi / 20.0;
Writeln(File_var, 41); {number of lines in the data}
Writeln(File_var, 41); {number of points in each line}
For I:=-20 to 20 do
For J:=-20 to 20 do
Begin
Sine_point := Sqrt(Sqr(1.0*I) + Sqr(1.0*J))*Scale;
If Abs(Sine_point) < 0.0000001 then
Writeln(File_var, 1.0)
Else
Writeln(File_var, Sqr(Sin(Sine_point)/Sine_point));
End;
Close(File_var);
End.