Code covered by the BSD License  

Highlights from
Hydromat

from Hydromat by Baharuddin Ali
Plot the body plan of ship 2D-3D & hydrostatic

PARAM(H0,SIG,B)
function PARAM(H0,SIG,B)
global A0 A1 A3
E=(H0-1.0)/(H0+1.0);
if(abs(SIG-pi/4.0)<=0.0001)
    AL3=0.0;
else
    E2=E*E;
    C=4.0*SIG*(1.0-E2)/pi+E2;
    D=-C/(C+3.0);
    D2=sqrt(D*D-(C-1.0)/(C+3.0));
    AL3=D+D2;
end
    AL1=E*(AL3+1.0);
    A0=B/(1.0+AL1+AL3);
    A1=A0*AL1;
    A3=A0*AL3;

Contact us at files@mathworks.com