program square_rot_sub real x(5),y(5),xrot(5),yrot(5) x(1)=-1 y(1)=1 x(2)=1 y(2)=1 x(3)=1 y(3)=-1 x(4)=-1 y(4)=-1 x(5)=x(1) y(5)=y(1) i_dummy=pgopen('/xwin') call pgenv(-5.0,5.0,-5.0,5.0,1,0) dtheta=3.14/18000 c 1000 do i=1,5 c xrot(i)=x(i)*cos(dtheta)-y(i)*sin(dtheta) c yrot(i)=x(i)*sin(dtheta)+y(i)*cos(dtheta) c end do 1000 call rot(5,x,y,xrot,yrot,dtheta) call pgbbuf call pgsci(0) call pgline(5,x,y) call pgsci(1) call pgline(5,xrot,yrot) call pgebuf do i=1,5 x(i)=xrot(i) y(i)=yrot(i) end do goto 1000 end subroutine rot(n,x,y,xrot,yrot,dtheta) real x(100),y(100),xrot(100),yrot(100) do i=1,n xrot(i)=x(i)*cos(dtheta)-y(i)*sin(dtheta) yrot(i)=x(i)*sin(dtheta)+y(i)*cos(dtheta) end do end