Compare commits

..

No commits in common. "dd552abeda6ab14eeb70784b2a732e4670aa9889" and "eef8e7db64db91cec92a38464599c042eadcb861" have entirely different histories.

5 changed files with 20 additions and 48 deletions

View File

@ -6,15 +6,6 @@ Voyons d'abord
[une vidéo](http://la.buvette.org/fractales/f90/video.html)
qui montre ma première expérience dans ce domaine.
## Trucs à voir
La fractale de Julia se porte plutôt bien.
* [mkjuliagif.sh](mkjuliagif.sh) : fabrication de la gif animée
* [julias.f90](julias.f90) : fonctions de dessin d'une Julia
* [mkjulia.f90](mkjulia.f90) : le programme principal
## La technique
Le gros des calculs de fractales est fait dans `mods/fraktals.f90`,
@ -43,7 +34,7 @@ Generally writen as a *sequencial unformated* file.
## TODO
- Voir de près le calcul du cadrage : [centermag](../Modules/centermag.f90)
- Voir de près le calcul du cadrage
- Rajouter des formules
- Ne pas procastiner sur le reste

View File

@ -1,5 +1,4 @@
module julias
implicit none
contains
@ -43,14 +42,13 @@ subroutine simple_julia(pic, cx, cy, maxiter)
if (over_iter) then
pic(ix, iy) = 0
else
pic(ix, iy) = mod(iter*13, 256)
pic(ix, iy) = iter*12
endif
enddo ! iy
enddo ! ix
end subroutine simple_julia
!===============================================================
subroutine julia_colormapped(pic, cx, cy, maxiter)
use pixrgb
type(t_pixrgb), intent(inout), dimension (:,:) :: pic
@ -66,11 +64,11 @@ subroutine julia_colormapped(pic, cx, cy, maxiter)
width = ubound(pic, 1)
height = ubound(pic, 2)
C = complex(cx, cy)
! print *, "Color julia, const = ", C
print *, "Color julia, const = ", C
do ix = 1, width
fx = (float(ix) / (float(width*2)/10.0) - 2.5)
fx = (float(ix) / (float(width*2)/4.0) - 1.0)
do iy = 1, height
fy = (float(iy) / (float(height*2)/10.0) - 2.5)
fy = (float(iy) / (float(height*2)/4.0) - 1.0)
! ------ traitement du pixel
iter = 0 ; over_iter = .FALSE.
Z = complex(fx, fy)
@ -87,9 +85,9 @@ subroutine julia_colormapped(pic, cx, cy, maxiter)
pic(ix, iy)%g = mod(abs(int(real(Z) *140)), 255)
pic(ix, iy)%b = mod(abs(int(aimag(Z)*140)), 255)
else
pic(ix, iy)%r = mod(iter*22, 255)
pic(ix, iy)%r = mod(iter*33, 255)
pic(ix, iy)%g = mod(iter*59, 255)
pic(ix, iy)%b = mod(iter*21, 255)
pic(ix, iy)%b = mod(iter*41, 255)
endif
enddo ! iy
enddo ! ix

View File

@ -28,13 +28,9 @@ program julia
allocate(picz(512, 342))
call julia_colormapped(picz, cx, cy, 2500)
call julia_colormapped(picz, cx, cy, 500)
call rgbpix_spit_as_pnm_8(picz, trim(filename))
contains
!-----------------------------------------------------
end program
!-----------------------------------------------------

View File

@ -11,41 +11,28 @@ if [ $? -ne 0 ] ; then
exit 1
fi
cxa=" -1.5 "
cya=" -1.0 "
cxb=" 1.1 "
cyb=" 2.1 "
nbi=" 180 "
#
# run the prog
#
workdir="frames/julia/"
for foo in $( seq 0 $(( nbi - 1)) )
for foo in $(seq 0 179)
do
img=$(printf "%s/%05d.pnm" $workdir $foo)
bar=$(echo "$foo / 247.0" | bc -l)
cx=$(echo "0.5 * (1.52*c($foo/28.0))" | bc -l)
cy=$(echo "0.5 * (1.45*s($foo/17.0))" | bc -l)
Ka=$( echo "$foo / $nbi" | bc -l)
Kb=$( echo "1.0 - $Ka" | bc -l)
# echo $Ka $Kb
cx=$(echo "($cxa*$Ka) + ($cxb*$Kb)" | bc -l)
cy=$(echo "$cya*$Ka + $cyb*$Kb" | bc -l)
printf "%5d %4.6f %4.6f %4.6f %4.6f\n" \
$foo $Ka $Kb $cx $cy
./mkjulia $img $cx $cy
sleep 145
done
mogrify \
-gravity South-East \
-font Courier-Bold \
-pointsize 12 \
-fill Black \
-annotate +10+4 "Konrad+tTh 2024" \
"${workdir}/*.pnm"
./tagpicz.sh $workdir
echo ; echo "Encoding, please wait..."
convert -delay 10 $workdir/*.pnm color-julia.gif
# animate foo.gif &

View File

@ -17,10 +17,10 @@ do
mogrify \
-gravity South-East \
-font Courier-Bold \
-font Courier \
-pointsize 12 \
-fill Black \
-annotate +10+4 "Konrad+tTh 2024" \
-fill firebrick \
-annotate +10+10 "Konrad+tTh 2023" \
$img
echo "tagging " $img