assez pour ce soir

This commit is contained in:
tTh
2023-03-21 00:16:54 +01:00
parent aa4f0664cb
commit 0db76fef58
6 changed files with 108 additions and 32 deletions

View File

@@ -2,6 +2,9 @@ program dessiner
use plplot
implicit none
integer :: i
real :: a, b, c, d
character(len=80) :: version
call plgver(version)
write (*,'(a,a)') 'plplot version: ', trim(version)
@@ -11,31 +14,53 @@ program dessiner
call plenv(-2.2, 2.2, -2.2, 2.2, 0, 1)
call dessin_1 ()
a = 0
b = 0
c = 0
d = 0
do i=1, 100
a = a + 0.01
b = b + 0.02
call dessin_1 (a, b, 12)
c = c + 0.03
d = d + 0.04
call dessin_1 (c, d, 13)
enddo
call plend
contains ! -----------------------------
subroutine dessin_1 ()
contains ! -----------------------------
!------------------------------------------------------
subroutine dessin_1 (sha, shb, color)
real, intent(in) :: sha, shb
integer, intent(in) :: color
integer, parameter :: lg = 500
integer, parameter :: lg = 2000
real :: x(lg), y(lg)
real :: k
real :: k, amp
integer :: i
k = 0.1
! print *, 'dessin 1'
amp = 2.0
do i = 1, lg
x(i) = k * sin(real(i)/3.0)
y(i) = k * cos(real(i)/3.0)
k = k * 1.0060
k = real(i)/real(lg) * 6.2832 * 4.0
x(i) = amp * sin((k+sha)*5)
y(i) = amp * cos((k+shb)*3)
enddo
print *, i, k, x(i), y(i)
! print *, k, x(i), y(i)
call plcol0 (15) ! pure white
call pllab ("Fuzzfactor", "Yoyodines", "Some nice plots from tTh")
call plcol0 (12)
call plcol0 (color)
call plline (x, y)
end subroutine
!------------------------------------------------------
subroutine dessin_2 ()
print *, 'dessin 2'
end subroutine
!------------------------------------------------------
end program

View File

@@ -2,7 +2,16 @@ program plplotting
use plplot
implicit none
! Initializing the plotting package with a lot of
! default (and pertinent) values.
call plinit ()
call plenv(-2.1, 2.1, -2.1, 2.1, 0, 0)
call plend
! Sets up plotter environment for simple graphs
call plenv (-2.1, 2.1, -2.1, 2.1, 0, 0)
! Ends a plotting session, tidies up all the output
! files,switches interactive devices back into text
! mode and frees up any memory that was allocated.
call plend ()
end program