pickover++

This commit is contained in:
tth 2022-02-16 00:18:35 +01:00
parent 8ac3e43c6b
commit 8905cf858b
4 changed files with 81 additions and 6 deletions

View File

@ -4,3 +4,6 @@ pickover
*.pgm
*.gif
*.asc
*.png

View File

@ -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

31
Fraktalism/pickover.f90 Normal file
View File

@ -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
!-----------------------------------------------------

34
Fraktalism/plotpick.sh Executable file
View File

@ -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__