add "make me a circle" thing
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user