diff --git a/Fraktalism/.gitignore b/Fraktalism/.gitignore index f75e05b..5a6cb68 100644 --- a/Fraktalism/.gitignore +++ b/Fraktalism/.gitignore @@ -4,3 +4,6 @@ pickover *.pgm *.gif +*.asc +*.png + diff --git a/Fraktalism/fraktals.f90 b/Fraktalism/fraktals.f90 index 866ec55..f379321 100644 --- a/Fraktalism/fraktals.f90 +++ b/Fraktalism/fraktals.f90 @@ -52,9 +52,10 @@ subroutine simple_julia(pic, cx, cy, maxiter) end subroutine simple_julia !----------------------------------------------------- -! -! -! +! +! d'après les pages 91/92 du livre de Roger T Stevens +! "Fractal programming in C" +! subroutine pickover_0(pic, count) implicit none integer, intent(inout), dimension (:,:) :: pic @@ -62,12 +63,13 @@ subroutine pickover_0(pic, count) double precision :: xa, ya, za, xb, yb, zb double precision :: ka, kb, kc, kd - integer :: i, px, py + integer :: i, w, h, px, py ka = 2.24 ; kb = 0.43 ; kc = -0.65 ; kd = -2.43 - xa = 0.00 ; ya = 0.00 ; za = 0.0 + w = ubound(pic, 1) + h = ubound(pic, 2) do i=1, count @@ -75,8 +77,13 @@ subroutine pickover_0(pic, count) yb = za*sin(kc*xa) - cos(kd*ya) zb = sin(xa) - print *, i, xb, yb, zb + px = (xb * (w/4.05)) + (w / 2) + py = (yb * (h/4.05)) + (h / 2) + pic(px, py) = 200 ! WARNING COREDUMP + + print *, xb, yb, zb + xa = xb ; ya = yb ; za = zb enddo diff --git a/Fraktalism/pickover.f90 b/Fraktalism/pickover.f90 new file mode 100644 index 0000000..8c2fbf2 --- /dev/null +++ b/Fraktalism/pickover.f90 @@ -0,0 +1,31 @@ +! +! this is the main programm +! +!----------------------------------------------------- + +program pickover + + use spitpgm + use fraktals + + implicit none + + integer, dimension(800, 600) :: picz + integer :: argc + character(200) :: filename + + argc = IARGC() + if (1 .NE. argc) then + STOP ": PICKOVER NEED A FILENAME !" + endif + + call getarg(1, filename) + + write (0, "(A)") "Pickover -> "//trim(filename) + + call pickover_0(picz, 50000) + call spit_as_pgm_8(picz, trim(filename)) + +end program + +!----------------------------------------------------- diff --git a/Fraktalism/plotpick.sh b/Fraktalism/plotpick.sh new file mode 100755 index 0000000..062cdb5 --- /dev/null +++ b/Fraktalism/plotpick.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +ASCFILE="nuage.asc" +IMAGE="pick3d.png" + +make pickover +if [ $? -ne 0 ] ; then + echo + echo "Make error " $? + exit 1 +fi + +./pickover foo.pgm > $ASCFILE +if [ $? -ne 0 ] ; then + echo + echo "Pickover error " $? + exit 1 +fi + + +gnuplot << __EOC__ +set term png size 1024,768 +set output "${IMAGE}" + +set title "3D Pickover" + +splot "$ASCFILE" with dots + +__EOC__ + + + + +