c generate screen data from Tom's surfcae points c NOTE: for left screen, flip sign of points to right side c real*8, dimension(3,3) :: p1, p2, p3, plaser1,plaser2, xnorm real*8, dimension(3) :: c,a ,b c do iscreen=1,3 read(*,*) read(*,*) plaser1(:,iscreen) read(*,*) plaser2(:,iscreen) read(*,*) p1(:,iscreen) read(*,*) p2(:,iscreen) read(*,*) p3(:,iscreen) c !c image for left side !c ! plaser1(2:3,iscreen)=-plaser1(2:3,iscreen) ! plaser2(2:3,iscreen)=-plaser2(2:3,iscreen) ! p1(2:3,iscreen)=-p1(2:3,iscreen) ! p2(2:3,iscreen)=-p2(2:3,iscreen) ! p3(2:3,iscreen)=-p3(2:3,iscreen) c c get screen normal c a=p2(:,iscreen)-p1(:,iscreen) b=p3(:,iscreen)-p2(:,iscreen) call axb(a,b,c) xnorm(:,iscreen)=c enddo c c write out data for doall script do iscreen=1,3 write(*,"(3f12.6)") plaser1(:,iscreen) write(*,"(3f12.6)") plaser2(:,iscreen) enddo c do iscreen=1,3 write(*,"(6f12.6)") xnorm(:,iscreen), p1(:,iscreen) enddo c stop end c********************************* subroutine axb(a,b,c) real*8, dimension(3) :: a, b, c real*8 c2 c c(1)=a(2)*b(3)-b(2)*a(3) c(2)=a(3)*b(1)-b(3)*a(1) c(3)=a(1)*b(2)-b(1)*a(2) c2=dot_product(c,c) if(c2.eq.0.d0)return c=c/sqrt(c2) return end