-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment2.m
46 lines (32 loc) · 939 Bytes
/
experiment2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Plot radiation graph from Lambertian source using H0_ER
%
% Plot of intensity as a function of irradiance angle (angle with the
% emitter axis) for a Lambertian emitter of order m
addpath('../ProjGeom/');
% Define base values
% - m (Lambertian mode number)
% - Ar (receiver area)
m = 1;
Ar = 1e-4;
% Emitter position and orientation:
% Emiiter in the origin, aligned with x axis
HTM_E = RotY3(pi/2);
%% Compute the values
% Receiver initial position:
% at (1,0,0), directed towards the origin
HTM_R_base = Trans3(1,0,0)*RotY3(-pi/2);
angles = linspace(0, 2*pi);
p_r = zeros(size(angles));
% Iterate over angle values
for i = 1:numel(angles)
% Compute receiver position and orientation
HTM_R = RotZ3(angles(i)) * HTM_R_base;
% Compute received power
p_r(i) = H0_ER(HTM_E, HTM_R, m, Ar);
end
%% Show the results
figure(1)
h = polar(angles,p_r);
t = sprintf('Polar plot, m=%d',m);
title(t);
figure(gcf);