Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
833 kaklik 1
function poincaresphere(I0,I45,I90,I135,Icr,Icl)
2
 
3
 
4
 
5
% COMPUTED PARAMETERS
6
 
7
%Stokes vectors
8
 
9
S0 = I0 + I90;
10
 
11
S1 = I0 - I90;
12
 
13
S2 = I45 - I135;
14
 
15
S3 = Icr - Icl;
16
 
17
 
18
 
19
P = sqrt( S1^2 + S2^2 + S3^2 ) / S0;
20
 
21
S = [S1 S2 S3]./S0;
22
 
23
 
24
 
25
fprintf('P = %f\n',P);
26
 
27
fprintf('S = (%f,%f,%f)\n',S(1),S(2),S(3));
28
 
29
 
30
 
31
% DRAWING SPHERE
32
 
33
 
34
 
35
% Sphere
36
 
37
[X Y Z] = sphere(20);
38
 
39
mesh(X,Y,Z,'edgecolor',[0.5 0.5 0.5]);
40
 
41
alpha(0.2);
42
 
43
axis equal;
44
 
45
hold on;
46
 
47
 
48
 
49
% DRAWING CIRCLES
50
 
51
 
52
 
53
% circle in Sx,Sy plane
54
 
55
t = 0:0.001:2*pi;
56
 
57
n = length(t);
58
 
59
Kx = cos(t);
60
 
61
Ky = sin(t);
62
 
63
Kz = zeros(n,1);
64
 
65
plot3(Kx,Ky,Kz,'LineWidth',2);
66
 
67
 
68
 
69
% circle Sy,Sz plane
70
 
71
Kx = zeros(n,1);
72
 
73
Ky = cos(t);
74
 
75
Kz = sin(t);
76
 
77
plot3(Kx,Ky,Kz,'LineWidth',2);
78
 
79
 
80
 
81
% circle in Sx,Sz plane
82
 
83
Kx = cos(t);
84
 
85
Ky = zeros(n,1);
86
 
87
Kz = sin(t);
88
 
89
plot3(Kx,Ky,Kz,'LineWidth',2);
90
 
91
 
92
 
93
% DRAWING AXES
94
 
95
 
96
 
97
% axis connecting 135 and 45
98
 
99
x = [0 0];
100
 
101
y = [-1.3 1.3];
102
 
103
z = [0 0];
104
 
105
plot3(x,y,z,'LineWidth',2,'Color',[0 1 0]);
106
 
107
text(0,1.4,0,'+S_y (45 st.)');
108
 
109
text(0,-1.4,0,'-S_y (135 st.)');
110
 
111
 
112
 
113
% axis connecting 0 and 90
114
 
115
x = [1.3 -1.3];
116
 
117
y = [0 0];
118
 
119
z = [0 0];
120
 
121
plot3(x,y,z,'LineWidth',2,'Color',[0 1 0]);
122
 
123
text(1.4,0,0,'+S_x (0 st.)');
124
 
125
text(-1.4,0,0,'-S_x (90 st.');
126
 
127
 
128
 
129
% axis connecting CR and CL
130
 
131
x = [0 0];
132
 
133
y = [0 0];
134
 
135
z = [1.3 -1.3];
136
 
137
plot3(x,y,z,'LineWidth',2,'Color',[0 1 0]);
138
 
139
text(0,0,1.4,'+S_z (CR)');
140
 
141
text(0,0,-1.4,'-S_z (LR)');
142
 
143
 
144
 
145
 
146
 
147
% plot Poincare vector
148
 
149
quiver3(0,0,0,S(1),S(2),S(3),'Color',[1 0 0],'LineWidth',3,'MaxHeadsize',6);
150
 
151
 
152
 
153
s = ['S = ' '(' num2str(S(1),'%1.3f') ', '  num2str(S(2),'%1.3f') ', ' num2str(S(3),'%1.3f') ')'];
154
 
155
m = sqrt( S(1)^2 + S(2)^2 + S(3)^2 );
156
 
157
P = [S(1)/m S(2)/m S(3)/m];
158
 
159
text(P(1)+0.1,P(2)+0.1,P(3)+0.1,s);
160
 
161
plot3(P(1),P(2),P(3),'r.','MarkerSize',25);