add "make me a circle" thing

This commit is contained in:
Tonton Th
2026-05-13 09:59:37 +02:00
parent 1dd0e71577
commit be961b46fc

View File

@@ -107,6 +107,34 @@ subroutine genp_plot_axes(amp)
call genp_draw( amp, 0.0, 7) call genp_draw( amp, 0.0, 7)
end subroutine end subroutine
! --------------------------------------------------------- ! ---------------------------------------------------------
subroutine genp_circle(radius, steps, color)
real, intent(in) :: radius
integer, intent(in) :: steps, color
integer :: idx
real :: fk, ang, x, y
logical :: firstdot
if (steps .LT.3 ) then
write(0, '("circle: steps ", I3, " bad value")') steps
return
endif
firstdot = .TRUE.
do idx=0, steps
fk = real(idx) / real(steps)
ang = 6.283185307 * fk
! write(0, '(I5, " -> ", 2F10.5)') idx, fk, ang
x = radius * cos(ang) ; y = radius * sin(ang)
if (firstdot) then
call genp_move(x, y) ; firstdot = .FALSE.
else
call genp_draw(x, y, color)
endif
enddo
end subroutine
! ---------------------------------------------------------
subroutine genp_end (foo) subroutine genp_end (foo)
integer, intent(in) :: foo integer, intent(in) :: foo