2015年6月4日 星期四

Plot -- Inverse Trigonometric Function

%========================================
% sin^-1(x)
%========================================
close all
figure,
x=-pi:0.1:pi;
y=sin(x);
plot(x,y,'--b')
x=[-pi/2:0.1:pi/2 pi/2];
y=sin(x);
hold on
plot(x,y,'b','LineWidth',3)
hold off
axis([-3.5 3.5 -1.5 1.5])
line( [0 0], [-1.5 1.5], 'color', 'm');
line( [-3.5 3.5], [0 0], 'color', 'm');
line( [-pi/2 -pi/2], [-1.05 0.05], 'color', 'r');
line( [pi/2 pi/2], [-0.05 1.05], 'color', 'r');
gtext('\fontname{Times New Roman}\fontsize{14}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{14}{\ity}')
gtext('(0,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm(-{\it\pi} /2,-1)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm({\it\pi} /2,1)')
gtext('\fontname{Times New Roman}\fontsize{14}{\itf}\rm({\itx}) = sin\itx')

x=-pi:0.1:pi;
y=sin(x);
figure, plot(x,y,'--b')
x=[-pi/2:0.1:pi/2 pi/2];
y=sin(x);
hold on
plot(x,y,'b','LineWidth',3)
x=-1:0.1:1;
y=asin(x);
plot(x,y,'g','LineWidth',3)
x=-2:0.1:2;
y=x;
plot(x,y,'--c')
hold off
axis([-2 2 -2 2])
line( [0 0], [-2 2], 'color', 'm');
line( [-2 2], [0 0], 'color', 'm');
line( [-pi/2 -pi/2], [-1.05 0.05], 'color', 'r');
line( [-1 -1], [-pi/2-0.05 0.05], 'color', 'b');
line( [pi/2 pi/2], [-0.05 1.05], 'color', 'r');
line( [1 1], [-0.05 pi/2+0.05], 'color', 'b');
line( [-1.05 0.05], [-pi/2 -pi/2], 'color', 'b');
line( [-0.05 1.05], [pi/2 pi/2], 'color', 'b');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm(-{\it\pi} /2,-1)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm({\it\pi} /2,1)')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = sin\itx')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm(-1,-{\it\pi} /2)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm(1,{\it\pi} /2)')
gtext('-1')
gtext('1')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = sin^{-1}\itx')



%========================================
% cos^-1(x)
%========================================
close all
figure,
x=-pi/2:0.1:3*pi/2;
y=cos(x);
plot(x,y,'--b')
x=[0:0.1:pi pi];
y=cos(x);
hold on
plot(x,y,'b','LineWidth',3)
hold off
axis([-0.5 3.5 -1.5 1.5])
line( [0 0], [-1.5 1.5], 'color', 'm');
line( [-3.5 3.5], [0 0], 'color', 'm');
line( [-0.5 0.05], [1 1], 'color', 'r');
line( [pi pi], [-1.05 0.05], 'color', 'r');
line( [pi/2 pi/2], [-0.05 0.05], 'color', 'r');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('(0,1)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm({\it\pi},-1)')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = cos\itx')
x=-2:0.1:3*pi/2;
y=cos(x);
figure, plot(x,y,'--b')
x=[0:0.1:pi pi];
y=cos(x);
hold on
plot(x,y,'b','LineWidth',3)
x=-1:0.1:1;
y=acos(x);
plot(x,y,'g','LineWidth',3)
x=-2:0.1:4;
y=x;
plot(x,y,'--c')
hold off
axis([-2 4 -2 4])
line( [0 0], [-2 4], 'color', 'm');
line( [-2 4], [0 0], 'color', 'm');
line( [-2 0.1], [1 1], 'color', 'r');
line( [pi pi], [-1.1 0.1], 'color', 'r');
line( [pi/2 pi/2], [-0.1 0.1], 'color', 'r');
line( [-0.1 0.1], [pi/2 pi/2], 'color', 'r');
line( [-2 -0.9], [pi pi], 'color', 'b');
line( [-1 -1], [-0.1 pi+0.1], 'color', 'b');
line( [1 1], [-0.1 0.1], 'color', 'b');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('-1')
gtext('1')
gtext('\fontname{Times New Roman}\fontsize{10}\rm({\it\pi} /2,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{10}\rm({\it\pi},-1)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm(-1,{\it\pi})')
gtext('\fontname{Times New Roman}\fontsize{10}\rm(0,{\it\pi} /2)')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = cos\itx')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = cos^{-1}\itx')



%========================================
% tan^-1(x)
%========================================
close all
figure,
x=[-pi/2+0.05:0.1:pi/2];
y=tan(x);
plot(x,y,'b','LineWidth',3)
axis([-10 10 -10 10])
line( [0 0], [-10 10], 'color', 'm');
line( [-10 10], [0 0], 'color', 'm');
line( [-pi/2 -pi/2], [-10 0.2], 'color', 'r');
line( [pi/2 pi/2], [-0.2 10], 'color', 'r');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = tan\itx')
x=[-pi/2+0.05:0.1:pi/2];
y=tan(x);
figure, plot(x,y,'b','LineWidth',3)
hold on
x=-10:0.1:10;
y=atan(x);
plot(x,y,'g','LineWidth',3)
x=-10:0.1:10;
y=x;
plot(x,y,'--c')
hold off
axis([-10 10 -10 10])
line( [0 0], [-10 10], 'color', 'm');
line( [-10 10], [0 0], 'color', 'm');
line( [-pi/2 -pi/2], [-10 0.2], 'color', 'r');
line( [pi/2 pi/2], [-0.2 10], 'color', 'r');
line( [-10 0.2], [-pi/2 -pi/2], 'color', 'b');
line( [-0.2 10], [pi/2 pi/2], 'color', 'b');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = tan\itx')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = tan^{-1}\itx')




%========================================
% cot^-1(x)
%========================================
close all
figure,
x=[0.05:0.1:pi];
y=cot(x);
plot(x,y,'b','LineWidth',3)
axis([-10 10 -10 10])
line( [0 0], [-10 10], 'color', 'm');
line( [-10 10], [0 0], 'color', 'm');
line( [pi pi], [-10 0.2], 'color', 'r');
line( [pi/2 pi/2], [-0.2 0.2], 'color', 'r');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = cot\itx')
x=[0.05:0.1:pi];
y=cot(x);
figure, plot(x,y,'b','LineWidth',3)
hold on
x=-10:0.1:-0.1;
y=acot(x)+pi;
x2=0:0.1:10;
y=[y acot(x2)];
plot([x x2],y,'g','LineWidth',3)
x=-10:0.1:10;
y=x;
plot(x,y,'--c')
hold off
axis([-10 10 -10 10])
line( [0 0], [-10 10], 'color', 'm');
line( [-10 10], [0 0], 'color', 'm');
line( [pi pi], [-10 0.2], 'color', 'r');
line( [-10 0.2], [pi pi], 'color', 'b');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = cot\itx')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = cot^{-1}\itx')




%========================================
% sec^-1(x) ------nonunique
%========================================
close all
figure,
x=[-pi/2+0.05:0.1:pi/2-0.05];
y=sec(x);
plot(x,y,'--b')
hold on
x3 = x-3*pi;  y=sec(x3);  plot(x3,y,'--b')
x2 = x-2*pi;  y=sec(x2);  plot(x2,y,'--b')
x1 = x-pi;    y=sec(x1);  plot(x1,y,'--b')
x3 = x+3*pi;  y=sec(x3);  plot(x3,y,'--b')
x2 = x+2*pi;  y=sec(x2);  plot(x2,y,'--b')
x1 = x+pi;    y=sec(x1);  plot(x1,y,'--b')
x=[0:0.1:pi/2-0.05];
y=sec(x);
plot(x,y,'b','LineWidth',3)
x=[pi/2+0.05:0.1:pi pi];
y=sec(x);
plot(x,y,'b','LineWidth',3)
axis([-10 10 -10 10])
hold off
line( [0 0], [-10 10], 'color', 'm');
line( [-10 10], [0 0], 'color', 'm');
line( [5*pi/2 5*pi/2], [-10 10], 'color', 'r');
line( [3*pi/2 3*pi/2], [-10 10], 'color', 'r');
line( [pi/2 pi/2], [-10 10], 'color', 'r');
line( [-5*pi/2 -5*pi/2], [-10 10], 'color', 'r');
line( [-3*pi/2 -3*pi/2], [-10 10], 'color', 'r');
line( [-pi/2 -pi/2], [-10 10], 'color', 'r');
line( [-0.5 0.5], [1 1], 'color', 'r');
line( [-0.4 pi+0.4], [-1 -1], 'color', 'r');
line( [pi pi], [-1.4 0.4], 'color', 'r');
line( [2*pi 2*pi], [-0.4 1.4], 'color', 'r');
line( [-pi -pi], [-1.4 0.4], 'color', 'r');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('1')
gtext('-1')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{10}\rm3{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm2{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm-{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = sec\itx')
figure,
x=[-pi/2+0.05:0.1:pi/2-0.05];
y=sec(x);
plot(x,y,'--b')
hold on
x3 = x-3*pi;  y=sec(x3);  plot(x3,y,'--b')
x2 = x-2*pi;  y=sec(x2);  plot(x2,y,'--b')
x1 = x-pi;    y=sec(x1);  plot(x1,y,'--b')
x3 = x+3*pi;  y=sec(x3);  plot(x3,y,'--b')
x2 = x+2*pi;  y=sec(x2);  plot(x2,y,'--b')
x1 = x+pi;    y=sec(x1);  plot(x1,y,'--b')
x=[0:0.1:pi/2-0.05];
y=sec(x);
plot(x,y,'b','LineWidth',3)
x=[pi/2+0.05:0.1:pi pi];
y=sec(x);
plot(x,y,'b','LineWidth',3)
x=[-10:0.1:-1];
y=asec(x);
plot(x,y,'g','LineWidth',3)
x=[1:0.1:10];
y=asec(x);
plot(x,y,'g','LineWidth',3)
x=-10:0.1:10;
y=x;
plot(x,y,'--c')
hold off
line( [0 0], [-10 10], 'color', 'm');
line( [-10 10], [0 0], 'color', 'm');
line( [pi/2 pi/2], [-10 10], 'color', 'r');
line( [-0.5 0.5], [1 1], 'color', 'r');
line( [-0.4 pi+0.4], [-1 -1], 'color', 'r');
line( [pi pi], [-1.4 0.4], 'color', 'r');
line( [-10 0.4], [pi pi], 'color', 'b');
line( [-1 -1], [-0.4 pi+0.4], 'color', 'b');
line( [1 1], [-0.4 0.4], 'color', 'b');
axis([-10 10 -10 10])
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('(0,0)')
gtext('1')
gtext('-1')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi} /2')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('-1')
gtext('1')
gtext('\fontname{Times New Roman}\fontsize{10}\rm{\it\pi}')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = sec\itx')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = sec^{-1}\itx')



%========================================
% csc^-1(x) ------nonunique
%========================================
close all
figure,
x=[0.05:0.1:pi-0.05];
y=csc(x);
plot(x,y,'--b')
hold on
x3 = x-3*pi;  y=csc(x3);  plot(x3,y,'--b')
x2 = x-2*pi;  y=csc(x2);  plot(x2,y,'--b')
x1 = x-pi;    y=csc(x1);  plot(x1,y,'--b')
x3 = x+3*pi;  y=csc(x3);  plot(x3,y,'--b')
x2 = x+2*pi;  y=csc(x2);  plot(x2,y,'--b')
x1 = x+pi;    y=csc(x1);  plot(x1,y,'--b')
x=[0:0.1:pi/2 pi/2];
y=csc(x);
plot(x,y,'b','LineWidth',3)
x=[-pi/2:0.1:-0.05 -0.05];
y=csc(x);
plot(x,y,'b','LineWidth',3)
axis([-10 10 -10 10])
hold off
line( [0 0], [-10 10], 'color', 'm');
line( [-10 10], [0 0], 'color', 'm');
line( [5*pi/2 5*pi/2], [-10 10], 'color', 'r');
line( [3*pi/2 3*pi/2], [-10 10], 'color', 'r');
line( [pi/2 pi/2], [-10 10], 'color', 'r');
line( [-5*pi/2 -5*pi/2], [-10 10], 'color', 'r');
line( [-3*pi/2 -3*pi/2], [-10 10], 'color', 'r');
line( [-pi/2 -pi/2], [-10 10], 'color', 'r');
line( [-0.5 0.5], [1 1], 'color', 'r');
line( [-0.4 pi+0.4], [-1 -1], 'color', 'r');
line( [pi pi], [-1.4 0.4], 'color', 'r');
line( [2*pi 2*pi], [-0.4 1.4], 'color', 'r');
line( [-pi -pi], [-1.4 0.4], 'color', 'r');
gtext('\fontname{Times New Roman}\fontsize{12}{\itx}')
gtext('\fontname{Times New Roman}\fontsize{12}{\ity}')
gtext('\fontname{Times New Roman}\fontsize{12}{\itf}\rm({\itx}) = csc\itx')


沒有留言:

張貼留言