function varargout = Sea_Shells(varargin)
% SEA_SHELLS M-file for Sea_Shells.fig
%      SEA_SHELLS, by itself, creates a new SEA_SHELLS or raises the existing
%      singleton*.
%
%      H = SEA_SHELLS returns the handle to a new SEA_SHELLS or the handle to
%      the existing singleton*.
%
% How to use the GUI:
%    - The user may either change the parameter values by manipulating
%      the various sliders, or use the pull down menu to select predefined
%      shells.
%    - Once the parameters have been selected, the corresponding shell
%      may be plotted by clicking on the Plot Shell button.
%    - The shell may then be rotated by clicking and dragging the mouse in
%      the figure.
%    
% Developed by Joceline Lega, Department of Mathematics, University
% of Arizona, 1998 and Spring 2008.
% 

% Edit the above text to modify the response to help Sea_Shells

% Last Modified by GUIDE v2.5 07-Aug-2008 20:55:14

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @Sea_Shells_OpeningFcn, ...
                   'gui_OutputFcn',  @Sea_Shells_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before Sea_Shells is made visible.
function Sea_Shells_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to Sea_Shells (see VARARGIN)

% Choose default command line output for Sea_Shells
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes Sea_Shells wait for user response (see UIRESUME)
% uiwait(handles.figure1);
set(handles.figure1,'Name',' Sea Shells');
set(handles.popupmenu1,'Value',3);
plot_shell(hObject, eventdata, handles)

% --- Outputs from this function are returned to the command line.
function varargout = Sea_Shells_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on slider movement.
function slider_1_Callback(hObject, eventdata, handles)
% hObject    handle to slider_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_1,'String',get(handles.slider_1,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_2_Callback(hObject, eventdata, handles)
% hObject    handle to slider_2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_2,'String',get(handles.slider_2,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_3_Callback(hObject, eventdata, handles)
% hObject    handle to slider_3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_3,'String',get(handles.slider_3,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_4_Callback(hObject, eventdata, handles)
% hObject    handle to slider_4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_4,'String',get(handles.slider_4,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_5_Callback(hObject, eventdata, handles)
% hObject    handle to slider_5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_5,'String',get(handles.slider_5,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_5_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_6_Callback(hObject, eventdata, handles)
% hObject    handle to slider_6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_6,'String',get(handles.slider_6,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_6_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_7_Callback(hObject, eventdata, handles)
% hObject    handle to slider_7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_7,'String',get(handles.slider_7,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_7_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_8_Callback(hObject, eventdata, handles)
% hObject    handle to slider_8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_8,'String',get(handles.slider_8,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_8_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_9_Callback(hObject, eventdata, handles)
% hObject    handle to slider_9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_9,'String',get(handles.slider_9,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_9_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_10_Callback(hObject, eventdata, handles)
% hObject    handle to slider_10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_10,'String',get(handles.slider_10,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_10_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_11_Callback(hObject, eventdata, handles)
% hObject    handle to slider_11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_11,'String',get(handles.slider_11,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_11_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_12_Callback(hObject, eventdata, handles)
% hObject    handle to slider_12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_12,'String',get(handles.slider_12,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_12_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_13_Callback(hObject, eventdata, handles)
% hObject    handle to slider_13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_13,'String',get(handles.slider_13,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_13_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_14_Callback(hObject, eventdata, handles)
% hObject    handle to slider_14 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_14,'String',get(handles.slider_14,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_14_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_14 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_15_Callback(hObject, eventdata, handles)
% hObject    handle to slider_15 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_15,'String',get(handles.slider_15,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_15_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_15 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_16_Callback(hObject, eventdata, handles)
% hObject    handle to slider_16 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_16,'String',get(handles.slider_16,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_16_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_16 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slider_17_Callback(hObject, eventdata, handles)
% hObject    handle to slider_17 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.slidertext_17,'String',get(handles.slider_17,'Value'))

% --- Executes during object creation, after setting all properties.
function slider_17_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slider_17 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


function plot_shell(hObject, eventdata, handles)
alpha1 = get(handles.slider_1,'Value');
beta1 = get(handles.slider_2,'Value');
phi1 = get(handles.slider_3,'Value');
mu1 = get(handles.slider_4,'Value');
Omega1 = get(handles.slider_5,'Value');
P1 = get(handles.slider_6,'Value');
WW1 = get(handles.slider_7,'Value');
WW2 = get(handles.slider_8,'Value');
A = get(handles.slider_9,'Value');
a = get(handles.slider_10,'Value');
b = get(handles.slider_11,'Value');
L = get(handles.slider_12,'Value');
N = get(handles.slider_13,'Value');
mm1 = get(handles.slider_14,'Value');
mm2 = get(handles.slider_15,'Value');
m3 = get(handles.slider_16,'Value');
m4 = get(handles.slider_17,'Value');

%Define shell to plot
NPoints1=150;
NPoints2=300;
alpha=alpha1/360*2*pi;
beta=beta1/360*2*pi;
phi=phi1/360*2*pi;
mu=mu1/360*2*pi;
Omega=Omega1/360*2*pi;
P=P1/360*2*pi;w1=WW1/360*2*pi;w2=WW2/360*2*pi;
m1=mm1/360*2*pi;
m2=mm2/360*2*pi;
delta1=(m2-m1)/NPoints1;
delta2=(m4-m3)/NPoints2;
[S,T]=meshgrid(m1:delta1:m2,m3:delta2:m4);

%Draw plot
RE=1./sqrt(cos(S).^2/(a^2)+sin(S).^2/(b^2));
if N==0
   g=0;
else
   g=2*pi/N*(T*N/2/pi-round(T*N/2/pi));
end
k=L*exp(-(2*(S-P)/w1).^2).*exp(-(2*g/w2).^2);
R = RE + k;
x=(A*sin(beta)*cos(T)+R.*cos(S+phi).*cos(T+Omega)-R.*sin(mu).*sin(S+phi).*sin(T+Omega)).*exp(T*cot(alpha));
y=(-A*sin(beta)*sin(T)-R.*cos(S+phi).*sin(T+Omega)-R.*sin(mu).*sin(S+phi).*cos(T+Omega)).*exp(T*cot(alpha));
z=(-A*cos(beta)+R.*sin(S+phi)*cos(mu)).*exp(T*cot(alpha));

surfl(x,y,z), shading interp
set(gca,'PlotBoxAspectRatio',[1 1 1])
set(gca,'DataAspectRatio',[1 1 1])
set(gca,'GridLineStyle','none')
colormap(copper)
axis off;
rotate3d on;


% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1
   switch get(handles.popupmenu1,'Value')
   case{1}
      % Oxystele
      alpha=84.9;
      beta=7;
      phi=-36;
      mu=0;
      Omega=0;
      P=0;w1=1;w2=1;
      m1=-70;
      m2=70;
      A=47;a=40;b=19;L=0;N=0;
      m3=-20*pi;
      m4=4*pi;
   case{2}
      % Natalina
      alpha=80;
      beta=40;
      phi=55;
      mu=10;
      Omega=30;
      P=2;w1=1;w2=1;
      m1=-270;
      m2=62;
      A=25;a=12;b=16;L=0;N=0;
      m3=-2*pi;
      m4=4*pi;
   case{3}
      % Lyria
      alpha=83.9;
      beta=-19;
      phi=45;
      mu=0;
      Omega=0;
      P=0;w1=6;w2=27;
      m1=-51;
      m2=9;
      A=50;a=40;b=14;L=4;N=8;
      m3=-8*pi;
      m4=4*pi;
   case{4}
      % Turritella
      alpha=88.9;
      beta=4;
      phi=55;
      mu=0;
      Omega=0;
      P=0;w1=1;w2=1;
      m1=-267;
      m2=39;
      A=22.2;a=1.3;b=1.5;L=0;N=0;
      m3=-30*pi;
      m4=4*pi;
   case{5}
      % Conus
      alpha=87;
      beta=7;
      phi=78;
      mu=0;
      Omega=0;
      P=0;w1=1;w2=1;
      m1=-180;
      m2=2;
      A=7;a=4.3;b=1;L=0;N=0;
      m3=-15*pi;
      m4=4*pi;
   case{6}
      % Turbo
      alpha=83;
      beta=45;
      phi=30;
      mu=5;
      Omega=5;
      P=30;w1=30;w2=30;
      m1=-230;
      m2=80;
      A=5;a=3;b=3;L=2;N=5;
      m3=-4*pi;
      m4=5*pi;
   case{7}
      % Struthiolaria
      alpha=86.8;
      beta=13;
      phi=40;
      mu=10;
      Omega=30;
      P=-15;w1=5;w2=5;
      m1=-168;
      m2=24;
      A=5;a=1.8;b=1.6;L=0.5;N=16;
      m3=-5*pi;
      m4=15*pi;
   case{8}
      % Nautilus
      alpha=80;
      beta=90;
      phi=0;
      mu=0;
      Omega=0;
      P=0;w1=1;w2=1;
      m1=-163;
      m2=163;
      A=2;a=2;b=1.5;L=0;N=0;
      m3=-pi;
      m4=4*pi;
   case{9}
      % Planorbis
      alpha=84;
      beta=85;
      phi=10;
      mu=45;
      Omega=5;
      A=45;a=20;b=30;P=0;L=0;w1=6;w2=27;N=8;
      m1=-150;
      m2=130;
      m3=-10*pi;
      m4=4*pi;
   case{10}
      % Epitonium
      alpha=85.9;
      beta=9;
      phi=81;
      mu=0;
      Omega=0;
      P=-60;w1=200;w2=20;
      m1=-270;
      m2=20;
      A=9.5;a=2.1;b=1.6;L=1.3;N=8.3;
      m3=-9*pi;
      m4=6*pi;
   case{11}
      % Helcion
      alpha=18;
      beta=90;
      phi=0;
      mu=0;
      Omega=-40;
      P=0;w1=1;w2=1;
      m1=-180;
      m2=180;
      A=450;a=400;b=310;L=0;N=0;
      m3=0;
      m4=4*pi;
   end
   
   set(handles.slider_1,'Value',alpha);
   set(handles.slidertext_1,'String',alpha);
   set(handles.slider_2,'Value',beta);
   set(handles.slidertext_2,'String',beta);
   set(handles.slider_3,'Value',phi);
   set(handles.slidertext_3,'String',phi);
   set(handles.slider_4,'Value',mu);
   set(handles.slidertext_4,'String',mu);
   set(handles.slider_5,'Value',Omega);
   set(handles.slidertext_5,'String',Omega);
   set(handles.slider_6,'Value',P);
   set(handles.slidertext_6,'String',P);
   set(handles.slider_7,'Value',w1);
   set(handles.slidertext_7,'String',w1);
   set(handles.slider_8,'Value',w2);
   set(handles.slidertext_8,'String',w2);
   set(handles.slider_9,'Value',A);
   set(handles.slidertext_9,'String',A);
   set(handles.slider_10,'Value',a);
   set(handles.slidertext_10,'String',a);
   set(handles.slider_11,'Value',b);
   set(handles.slidertext_11,'String',b);
   set(handles.slider_12,'Value',L);
   set(handles.slidertext_12,'String',L);
   set(handles.slider_13,'Value',N);
   set(handles.slidertext_13,'String',N);
   set(handles.slider_14,'Value',m1);
   set(handles.slidertext_14,'String',m1);
   set(handles.slider_15,'Value',m2);
   set(handles.slidertext_15,'String',m2);
   set(handles.slider_16,'Value',m3);
   set(handles.slidertext_16,'String',m3);
   set(handles.slider_17,'Value',m4);
   set(handles.slidertext_17,'String',m4);

   plot_shell(hObject, eventdata, handles)
   
   
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
plot_shell(hObject, eventdata, handles)


