split julia

This commit is contained in:
tTh
2023-01-01 14:28:52 +01:00
parent 1b3f93ecfe
commit da56a6d0c0
6 changed files with 98 additions and 66 deletions

View File

@@ -1,15 +1,8 @@
module fraktals
use points3d
implicit none
contains
!===============================================================
!-
! Enfin un debut de Mandelbrot :)
!-
!===============================================================
! nouveau 28 mai 2022 (again)
! source:
@@ -44,55 +37,6 @@ subroutine parasites_0(pic, cx, cy, maxiter)
end subroutine parasites_0
!===============================================================
!-
! some problems with color mapping, need more work
!-
subroutine simple_julia(pic, cx, cy, maxiter)
implicit none
integer, intent(inout), dimension (:,:) :: pic
real, intent(in) :: cx, cy
integer, intent(in) :: maxiter
integer :: ix, iy, width, height
real :: fx, fy
complex :: Z, C
integer :: iter
logical :: over_iter
width = ubound(pic, 1)
height = ubound(pic, 2)
C = complex(cx, cy)
print *, "Const = ", C
! ready ? ok, clear the picture
pic = 0
do ix = 1, width
fx = (float(ix) / (float(width)/4.0) - 2.0)
do iy = 1, height
fy = (float(iy) / (float(height)/4.0) - 2.0)
! ------ traitement du pixel
iter = 0 ; over_iter = .FALSE.
Z = complex(fx, fy)
do while (modulus2(Z) .LT. 4.0)
Z = (Z * Z) + C
iter = iter + 1
if (iter .GE. maxiter) then
over_iter = .TRUE.
exit
endif
end do
if (over_iter) then
pic(ix, iy) = 0
else
pic(ix, iy) = iter*12
endif
enddo ! iy
enddo ! ix
end subroutine simple_julia
!===============================================================
!-
! d'après les pages 91/92 du livre de Roger T Stevens
! "Fractal programming in C"
!-