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) [une vidéo](http://la.buvette.org/fractales/f90/video.html)
qui montre ma première expérience dans ce domaine. 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 ## La technique
Le gros des calculs de fractales est fait dans `mods/fraktals.f90`, Le gros des calculs de fractales est fait dans `mods/fraktals.f90`,
@ -43,7 +34,7 @@ Generally writen as a *sequencial unformated* file.
## TODO ## TODO
- Voir de près le calcul du cadrage : [centermag](../Modules/centermag.f90) - Voir de près le calcul du cadrage
- Rajouter des formules - Rajouter des formules
- Ne pas procastiner sur le reste - Ne pas procastiner sur le reste

View File

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

View File

@ -28,13 +28,9 @@ program julia
allocate(picz(512, 342)) 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)) call rgbpix_spit_as_pnm_8(picz, trim(filename))
contains
!-----------------------------------------------------
end program end program
!----------------------------------------------------- !-----------------------------------------------------

View File

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

View File

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