C NLOGO     SOURCE    PV        05/09/22    21:21:50     5181
C NLOGO     SOURCE    ENSAM     94/09/29    21:15:28     1275
c subroutine utilisee dans tableau
c source ensam    aout 94


***************************************************
*
*  AFFICHE LE LOGO
*
***************************************************
        SUBROUTINE NLOGO (ICOUL,XPOS,YPOS,ECH)
*
*  DEFINITION DES VARIABLES
*
*  icoul        couleur
*  xpos,ypos    position du logo dans la fenetre
*  ech          echelle du logo
      IMPLICIT INTEGER(I-N)
        integer icoul
        real  xpos,ypos,ech
*
        integer ibn,icn,idens
        real  angle,tcx,tcy,ra,rb,tx(2),ty(2),tz(2),ti,pi
        real  coef
*
        tz(1)=0
        tz(2)=0
        ra    = ech/2.2
        rb    = ech/7.
        pi    = 4*atan(1.)
        idens = ech*60.0
        idens = max(idens,10)
        idens = min(idens,300)
        coef  = pi/(real(idens))
        call chcoul(icoul)
*
* TRACE DES BOULES
*
          tcx = xpos
          tcy = ypos
          do 300 icn=1 , idens
            ti = real(icn)*coef
            tx(1) = tcx + cos(ti)*rb
            ty(1) = tcy + sin(ti)*rb
            tx(2) = tcx - cos(ti)*rb
            ty(2) = tcy - sin(ti)*rb
            call polrl(2,tx,ty,tz)
300       continue
        angle = pi/2.
        do 500 ibn=1 , 6
          tcx = xpos + cos(angle)*ra
          tcy = ypos + sin(angle)*ra
          do 400 icn=1 , idens
            ti = real(icn)*coef
            tx(1) = tcx + cos(ti)*rb
            ty(1) = tcy + sin(ti)*rb
            tx(2) = tcx - cos(ti)*rb
            ty(2) = tcy - sin(ti)*rb
            call polrl(2,tx,ty,tz)
400       continue
          angle = angle + pi/3.
500     continue
*
* TRACE DES LIAISONS ENTRE LES BOULES
*
        call chcoul(icoul)
        tx(1) = xpos
        ty(1) = ypos
        tx(2) = xpos
        ty(2) = ypos - ra
        call polrl(2,tx,ty,tz)
        tx(2) = xpos
        ty(2) = ypos + ra
        call polrl(2,tx,ty,tz)
        tx(2) = xpos + ra*cos(pi/6.)
        ty(2) = ypos - ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
        tx(2) = xpos - ra*cos(pi/6.)
        ty(2) = ypos - ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
        tx(2) = xpos + ra*cos(pi/6.)
        ty(2) = ypos + ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
        tx(2) = xpos - ra*cos(pi/6.)
        ty(2) = ypos + ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
        tx(1) = xpos
        ty(1) = ypos - ra
        tx(2) = xpos + ra*cos(pi/6.)
        ty(2) = ypos - ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
        tx(1) = xpos
        ty(1) = ypos - ra
        tx(2) = xpos + ra*cos(pi/6.)
        ty(2) = ypos + ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
        tx(1) = xpos
        ty(1) = ypos - ra
        tx(2) = xpos - ra*cos(pi/6.)
        ty(2) = ypos - ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
        tx(1) = xpos
        ty(1) = ypos + ra
        tx(2) = xpos + ra*cos(pi/6.)
        ty(2) = ypos + ra*sin(pi/6.)
        call polrl(2,tx,ty,tz)
*
        END
*
******   FIN DE LA PROCEDURE   NLOGO   ************
***************************************************



