30. 48

>      restart:with(plots):with(plottools):

>      MminModule:=module()

>      export SolvMMin,runMMin:

>      SolvMMin:=proc() local i,x,y,Ris,N,F,xc,yc,Jxy,

>         Jx,Jy,Jxc,Jyc,Jxyc,Jmax,Jmin,alf,T,Z:

>      use Maplets[Tools] in

>      x:=Get('Tx'::list); # x  

>      y:=Get('Ty'::list); # y

>      x:=[op(x),x[1]];

>      y:=[op(y),y[1]];

>      N:=nops(x);#  

>      T:=matrix(2,N,[x,y]); #

>      Ris:=display(polygonplot(T,color="Yellow",scaling=constrained)):

>      Z:=i->T[2,i]*T[1,i+1]-T[1,i]*T[2,i+1]:

>      F:=add(Z(i),i=1..N-1)/2;#          

>      xc:=add(Z(i)*(T[1,i]+T[1,i+1]),i=1..N-1)/6/F;# .

>      yc:=add(Z(i)*(T[2,i]+T[2,i+1]),i=1..N-1)/6/F;              

>      Jx:=add(Z(i)*(T[2,i+1]^2+T[2,i+1]*T[2,i]+T[2,i]^2),i=1..N-1)/12;#

>      Jy:=add(Z(i)*(T[1,i+1]^2+T[1,i+1]*T[1,i]+T[1,i]^2),i=1..N-1)/12;

>      Jxy:=add(Z(i)*(T[1,i+1]*T[2,i+1]+(T[2,i+1]*T[1,i]+T[1,i+1]*T[2,i])/2
     +T[1,i]*T[2,i]),i=1..N-1)/12;
           

>       Jxc:=Jx-yc^2*F; Jyc:=Jy-xc^2*F; Jxyc:=Jxy-yc*xc*F;#         

       

>    Jmax:=((Jxc+Jyc)/2+sqrt((Jxc-Jyc)^2/4+Jxyc^2));

>    Jmin:=((Jxc+Jyc)/2-sqrt((Jxc-Jyc)^2/4+Jxyc^2));

>    alf:=arctan(Jxyc/(Jyc-Jmax));#arctan(2*Jxyc/(Jyc-Jxc))/2;

>    Set(TF=F):

>    Set(Txc=xc):

>    Set(Tyc=yc):

>    Set(TJx=Jx):

>    Set(TJy=Jy):

>    Set(TJxy=Jxy):

>    Set(TJxc=Jxc):

>    Set(TJyc=Jyc):

>    Set(TJxyc=Jxyc):

>    Set(TJmax=Jmax):

>    Set(TJmin=Jmin):

>    Set(Talf=alf):

>    end use;

>    Ris;

>    end proc;#SolMMin

>   

>    runMMin:=proc()

>    local a1,a2,t,z,c1,c2,p1,mplt;

>    z:='width'=7,editable = false:

>    use Maplets:-Elements in

>    t[1]:=["F=",TextField['TF'](z,'tooltip'="")]:

>    t[2]:=["xc=",TextField['Txc'](z)]:

>    t[3]:=["yc=",TextField['Tyc'](z)]:

>    t[4]:=["Jx=",TextField['TJx'](z)]:

>    t[5]:=["Jy=",TextField['TJy'](z)]:

>    t[6]:=["Jxy=",TextField['TJxy'](z)]:

>    t[7]:=["Jxc=",TextField['TJxc'](z)]:

>    t[8]:=["Jyc=",TextField['TJyc'](z)]:

>    t[9]:=["Jxyc=",TextField['TJxyc'](z)]:

>    t[10]:=["Jmax=",TextField['TJmax'](z)]:

>    t[11]:=["Jmin=",TextField['TJmin'](z)]:

>    t[12]:=["alpha=",TextField['Talf'](z)]:

>    a1:=["[x]=",TextField['Tx'](30,'value'=[0,2,1.9,1.4,0.9,0,5,5,7,7,5,7,2,2,0],'tooltip'=" x, ")]:

>    a2:=["[y]=",TextField['Ty'](30,'value'=[4,4,4.8,5.4,5.8,6,6,7,7,4,4,0,0,2,0],'tooltip'=" y")]:

>    c1:=Button('width=90',"Run", Evaluate('PL1' = 'display(SolvMMin())')):

>    c2:=Button("OK",Shutdown(['PL1'])):       

>    p1:=Plotter['PL1']('height=300'):

>    mplt:=Maplet(Evaluate(function = 'SolvMMin()'),

>          Window('title'=" ",

>          [" ",

>            [BoxColumn('spacing'=2,seq(t[i],i=1..12)),[a1,a2,p1]],[c1,c2]         

>          ]     )

>                 ):#Maplet

>        Maplets:-Display(mplt):

>    end use;

>    end proc;

>    end module:

>    MminModule:-runMMin():

Initializing Java runtime environment.

>