Fortraneries/Fraktalism/mkmandel.f90

49 lines
1.4 KiB
Fortran
Raw Normal View History

2022-02-07 16:20:42 +01:00
!-----------------------------------------------------
2022-12-30 02:06:00 +01:00
! MANDELBROT SET
!-
! refactored Thu 29 Dec 2022 03:21:16 PM CET
2022-12-31 13:25:02 +01:00
! refactored Sat 31 Dec 2022 12:37:03 PM CET
! all generative parts are now in 'mandelbrots.f90' module
2022-12-30 02:06:00 +01:00
!-
2022-02-07 16:20:42 +01:00
!-----------------------------------------------------
!
! this is the main programm
!
2022-02-12 13:34:44 +01:00
program mkmandel
2022-12-27 01:29:04 +01:00
use pixrgb
2022-12-31 13:25:02 +01:00
use mandelbrots
2022-02-07 16:20:42 +01:00
implicit none
2022-12-27 01:29:04 +01:00
type(t_pixrgb), allocatable :: pic(:,:)
2022-02-07 16:20:42 +01:00
integer :: angle
real :: radangle, radius
real :: stx, sty
character (len=80) :: filename
2022-12-30 02:06:00 +01:00
write(0, *) "-------- making some mandelbrot -------"
2022-02-07 16:20:42 +01:00
2023-05-03 02:46:52 +02:00
allocate(pic(640, 480))
2022-12-27 19:59:07 +01:00
2023-05-03 02:46:52 +02:00
do angle = 0, 2000
2022-12-27 01:29:04 +01:00
call rgbpix_set_to_zero(pic)
2022-02-07 16:20:42 +01:00
2022-12-30 02:06:00 +01:00
radangle = float(angle) * 0.01664
2022-12-31 13:25:02 +01:00
radius = float(angle) / 2000.0
2022-12-27 01:29:04 +01:00
write (filename, "(a, i5.5, a)") "frames/mandel/", angle, ".pnm"
2022-02-07 16:20:42 +01:00
! filename = trim(filename)
2023-05-03 02:46:52 +02:00
write(0,*) "passe ", angle, radangle, trim(filename)
2022-02-07 16:20:42 +01:00
2023-05-03 02:46:52 +02:00
stx = radius * (sin(radangle*4.07) + 0.2131*sin(radangle*11.36))
sty = radius * (cos(radangle*6.21) + 0.2725*cos(radangle*10.99))
2022-02-07 16:20:42 +01:00
2022-12-31 13:25:02 +01:00
call mandelbrot_one(pic, complex(stx, sty))
2022-12-27 01:29:04 +01:00
call rgbpix_spit_as_pnm_8 (pic, trim(filename))
2022-02-07 16:20:42 +01:00
2022-12-31 13:25:02 +01:00
enddo
2022-02-07 16:20:42 +01:00
end
!-----------------------------------------------------