[UP]


Manual Reference Pages  - rect (3)

NAME

rect(3f) - [M_pixel:POLYGON] draw rectangle given two corners (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

definition:

   subroutine rect(x1,y1, x2,y2)
   real,intent(in) :: x1,y1,x2,y2

DESCRIPTION

Draw rectangle given two opposite corners.

OPTIONS

X1,Y1 coordinates of a corner of the rectangle
X2,Y2 coordinates of corner point opposite first point

EXAMPLE

Sample program:

   program demo_rect
   use M_pixel
   use M_writegif, only : writegif
   implicit none
      integer :: i

!! set up graphics area call prefsize(400,400) call vinit() call ortho2(left=-100.0, right=100.0, bottom=-100.0, top=100.0)

!! draw some filled rectangles do i=95,5,-10 call makepoly() call color(i/10) call rect( -1.0*i, -1.0*i, 1.0*i, 1.0*i ) call closepoly() enddo

!! draw some rectangles call linewidth(50) call color(7) do i=5,95,5 call rect( -1.0*i, -1.0*i, 1.0*i, 1.0*i ) enddo

!! render pixel array to a file call writegif(’rect.3m_pixel.gif’,P_pixel,P_colormap)

!! display graphic assuming display(1) is available call execute_command_line(’display rect.3m_pixel.gif’)

!! wrap up graphics call vexit()

end program demo_rect

AUTHOR

John S. Urban

LICENSE

Public Domain


rect (3) March 11, 2021
Generated by manServer 1.08 from d954bca0-7956-43af-b966-997589eddf51 using man macros.