Simulates the area and
the perimeter of random polygons of N vertices, inscribed in
a unit circle (R = 1).
Files involved:
RandomPolygons.php,
randomPolygons.py,
modRandomPolygons.f90.
Advantage is taken from: PHP,
for the web page; Python, as "glue";
Fortran and C, for numerical segment;
and 'gnuplot', for plotting.
Draws graphs of the statistical behavior
of the area and of the perimeter.
Python file (download): randPolygons.py
(all scripts available, if sollicited)
Computation structure — A PHP file
(this page: 'P-RandPolygons.php') calls
(via 'action=...') an intermediate PHP file ('RandPolygons.php'),
which (through $_POST) sends the problem data
as command line arguments to a Python script.
This last does the computing, and makes 'system' call(s)
to 'gnuplot', for the final (temporary) webpage.
Keywords: PHP, command line arguments,
Python script, FOrtran, C, gnuplot. |