      program flow
      implicit none

      integer x_dim, y_dim, points
      parameter (x_dim = 256, y_dim=256)
      parameter (points = 256)
      integer i, j

      real x_coord(points), y_coord(points), dx (points), dy (points)
      integer image_buffer (256,256)
      integer x (points), y (points)
      integer color (points)
      integer dummy

      call x_display_init (x_dim, y_dim)

      x_coord = 0
      y_coord = 0
      do i = 1,points
         x_coord(i)=sin(i*2*3.1415926*8/real(points))
     $              *(real(i)/real(points))
      end do
      do i = 1,points
         y_coord(i)=cos(i*2*3.1415926*8/real(points))
     $              *(real(i)/real(points))
      end do
      x_coord = 0.5*x_coord
      y_coord = 0.5*y_coord
      do i = 1, 250
        dx = x_coord + (i/25.0) * y_coord * x_coord
        dy = - y_coord - (i/50.0) * x_coord * (y_coord-x_coord)
        x_coord = x_coord + 0.01 * dx
        y_coord = y_coord + 0.01 * dy
c       display all points
        image_buffer = 50
        do j = 1, points
           x(j) = 128 + x_coord(j) * 128
           y(j) = 128 + y_coord(j) * 128
           color (j) = 255
        end do
        do j = 1, points
           if ( (x(j) .gt. 0) .and. (x(j) .le. 256) .and. 
     $          (y(j) .gt. 0) .and. (y(j) .le. 256) ) then
             image_buffer (x(j),y(j)) = color (j)
           end if
        end do
        call x_show_bild (image_buffer)
      end do
      read *, dummy
      end 
