%
%  geometry_entry.m  ver 1.3  October 15, 2012
%
function[ccc,A,I,L]=geometry_entry(iu)
%
iflag=0;
%
disp(' ');
disp(' Enter the cross-section: ');
disp('   1=rectangle      ');
disp('   2=solid cylinder '); 
disp('   3=pipe           ');
disp('   4=other          ');
%
icross=input(' ');
disp(' ');
if(icross==1)
%
            if(iu==1)
                width=input(' Enter the width (inch) ');
                thick=input(' Enter the thickness (inch) ');
            else
                width=input(' Enter the width (m) ');
                thick=input(' Enter the thickness (m) ');                
            end
%            
			A=width*thick;
			I=(1./12.)*width*(thick^3.);
            ccc=thick/2;
            iflag=1;
end
if(icross==2)
            if(iu==1)
                diam=input(' Enter the diameter (inch) ');
            else
                diam=input(' Enter the diameter (m) ');                
            end
			A=(pi/4.)*(diam^2.);
			I=(pi/64.)*(diam^4.);
            ccc=diam/2;
            iflag=1;
end
if(icross==3)
            if(iu==1)
                diam_out=input(' Enter the outer diameter (inch) ');
                    wall=input(' Enter the wall thickness (inch) ');
            else
                diam_out=input(' Enter the outer diameter (m) ');
                    wall=input(' Enter the wall thickness (m) ');               
            end
%
            diam_in=diam_out-2*wall;
%
			A= (pi/4)*(diam_out^2 - diam_in^2);
			I=(pi/64)*(diam_out^4 - diam_in^4);
            ccc=diam_out/2;
            iflag=1;
end
if(iflag==0)
            if(iu==1)
                disp(' ');
                I = input(' Enter the area moment of inertia (in^4) ');
%
                disp(' ');
                A = input(' Enter the cross-section area (in^2) ');
                disp(' ');
                ccc = input(' Enter the distance from the neutral axis (in)');
            else
                I = input(' Enter the area moment of inertia (m^4) ');
%
                disp(' ');
                A = input(' Enter the cross-section area (m^2) ');
                disp(' ');
                ccc = input(' Enter the distance from the neutral axis (m)');                
            end
end
%
disp(' ');
if(iu==1)
    L = input(' Enter the length (inch) ');
else
    L = input(' Enter the length (m) ');    
end