diff --git a/genplotting.f90 b/genplotting.f90 index c4deceb..05cad12 100644 --- a/genplotting.f90 +++ b/genplotting.f90 @@ -107,6 +107,34 @@ subroutine genp_plot_axes(amp) call genp_draw( amp, 0.0, 7) 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) integer, intent(in) :: foo