% Schematic8.m
clear all; clc; clf; hold on; h1 = ellipse(2,1,0,0,0,'k'); 
set(h1,'linewidth',1.5)
% intersection point
xa = 1.827; ya = 0.4067;
plot(xa,ya,'ko','MarkerEdgeColor','k','MarkerFaceColor','k',...
    'markersize',8.)
text('Interpreter','latex', 'String','$$(x(\phi), y(\phi))$$',...
    'position',[2.144 0.1876 30.96],'FontSize',25)
% tangential line
tx =linspace(0.8,2.15,500); y = (1.0 - 0.25*xa*tx)/ya;
plot(tx,y,'k-','linewidth',2)
% orthorgonal line 
tx2 =linspace(-0,1.23,500); y2 = 4*ya*tx2/(xa);
plot(tx2,y2,'k-','linewidth',2)
% intersection point
xa2 = 1.215; ya2 = 1.082;
plot(xa2,ya2,'ko','MarkerEdgeColor','k','MarkerFaceColor','k',...
    'markersize',8.)
p1 = [1.131 1.018 1.124]; p2 = [1.207 1.106 1.001];
line([p1(1) p1(2) p1(3)],[p2(1) p2(2) p2(3)],'color','k', ...
      'linewidth',1.5)
text('Interpreter','latex', 'String','$$S(\phi)$$',...
    'position',[0.1413 0.7217 30.96],'FontSize',25)
theta = linspace(0.6*pi,0.69*pi,1000);
tmpx = 2*cos(theta) + 1.82; tmpy = 2*sin(theta) - 0.82; 
plot(tmpx,tmpy,'k-','linewidth',1)
theta = linspace(0.76*pi,0.865*pi,1000);
tmpx = 2*cos(theta) + 1.82; tmpy = 2*sin(theta) - 0.82; 
plot(tmpx,tmpy,'k-','linewidth',1)
% angle
r =0.85;theta=linspace(0,pi/14,500);aa=r*cos(theta);bb=r*sin(theta);
plot(aa,bb,'k','linewidth',1.5)
text('Interpreter','latex', 'String','$$\theta$$',...
    'position',[1.009 0.1208 30.96],'FontSize',25)
line([xa xa+0.8],[ya ya],'color','k','linewidth',...
1.5,'linestyle','--')
temp = linspace(xa,xa+0.1,200); 
line([xa 2.475],[ya 1.0],'color','k','linewidth',...
1.5,'linestyle','--')
% angle
r=0.4;theta=linspace(0,pi/4.3,500);aa=r*cos(theta);bb=r*sin(theta);
plot(aa,bb,'k','linewidth',1.5)
r=0.43;theta=linspace(0,pi/4.3,500);aa=r*cos(theta);bb=r*sin(theta);
plot(aa,bb,'k','linewidth',1.5)
% angle
r=0.4;theta=linspace(0,pi/4.3,500);
aa=r*cos(theta)+xa;bb=r*sin(theta)+ya;
plot(aa,bb,'k','linewidth',1.5)
r = 0.43; theta = linspace(0,pi/4.3,500);
aa = r*cos(theta) + xa; bb = r*sin(theta) + ya;
plot(aa,bb,'k','linewidth',1.5)
text('Interpreter','latex','String','$$\phi$$',...
'Position',[2.3691 0.647],'FontSize',15)            
text('Interpreter','latex', 'String','$$\theta$$',...
'Position',[0.926 0.100],'FontSize',15)            
text('Interpreter','latex','String','$$$$({x}({$$\phi$$}),{y}({$$\phi$$}))$$$$',...
'Position',[2.096 0.218],'FontSize',15)
text('Interpreter','latex','String','$$$${S}({$$\phi$$})$$$$',...
'Position',[0.265 0.725],'FontSize',15)
text('Interpreter','latex','String','$$r$$',...
'Position',[0.820 0.352],'FontSize',15)
theta = linspace(0.45*pi,0.555*pi,1000);
tmpx = 2.5*cos(theta) + 1.41; tmpy = 2.5*sin(theta) - 2.07; 
plot(tmpx,tmpy,'k-','linewidth',1)
theta=linspace(0.582*pi,0.685*pi,1000);
tmpx=2.5*cos(theta)+1.41; tmpy=2.5*sin(theta)-2.07; 
plot(tmpx,tmpy,'k-','linewidth',1)
line([0 xa], [0 ya],'color','k','linewidth',1.5)
line([-2.5 2.5], [0 0],'color','k','linewidth',1.5)
line([0 0],[-1.5 1.5],'color','k','linewidth',1.5)
plot(0,1.5,'k^','MarkerEdgeColor','k','MarkerFaceColor','k',...
    'markersize',10)
plot(2.5,0,'k>','MarkerEdgeColor','k','MarkerFaceColor','k',...
    'markersize',10)
text('Interpreter','latex', 'String','$$O$$',...
    'position',[-0.272 -0.159],'FontSize',25)
text('Interpreter','latex', 'String','$$x$$',...
    'position',[2.223 -0.173],'FontSize',20)
text('Interpreter','latex', 'String','$$y$$',...
    'position',[-0.2327 1.296],'FontSize',20)
axis image; axis([-2.2 3.0 -1.2 1.5])
axis off; print -deps test.eps
set(gcf,'PaperPositionMode','auto')