program square_rot real x(5),y(5),xnew(5),ynew(5) write(*,*)'drgrees for rotation?' read(*,*)n idummy=pgopen('/xwin') call pgenv(-10.0,10.0,-10.0,10.0,1,0) x(1)=2 y(1)=2 x(2)=2 y(2)=-2 x(3)=-2 y(3)=-2 x(4)=-2 y(4)=2 x(5)=x(1) y(5)=y(1) d_theta=2*3.14159/360 theta=n*d_theta do i=1,5 xnew(i)=x(i)*cos(theta)-y(i)*sin(theta) ynew(i)=x(i)*sin(theta)+y(i)*cos(theta) end do call pgline(5,xnew,ynew) call pgclos end