Files
GenPlotting90/spirale.f90
2026-05-15 11:30:09 +02:00

42 lines
1.1 KiB
Fortran

!
! SPIRALING...
! new Thu Apr 23 04:27:03 PM UTC 2026
!
! this crapware is released under the
! DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
!
program spirale
use genplotting
implicit none
character(*), parameter :: scratch = "WS/spirale.scratch"
write (0, '(A)') "----[ genplotting spirale ]----"
call genp_init (0, scratch)
call do_spirale (1337, 0.51, 0.0666, 0.7, 5)
call do_spirale (1337, 0.42, 0.0333, 0.7, 6)
call genp_end (0)
call genp_do_render(scratch, "WS/a.tga", 512, 512)
contains
! ---------------------------------------------------------
subroutine do_spirale (nbpass, kdist, krad, phy, col)
integer, intent(in) :: nbpass, col
real, intent(in) :: kdist, krad, phy
integer idx
real rad, px, py, dist
px = 0.0 ; py = 0.0
call genp_move (px, py)
do idx=1, nbpass
dist = real(idx) * kdist
rad = (real(idx) * krad) + phy
px = dist * sin(rad)
py = dist * cos(rad)
call genp_draw (px, py, col)
enddo
end subroutine
! ---------------------------------------------------------
end program