PageRenderTime 11ms CodeModel.GetById 6ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/test_mc_func.m

http://github.com/gallamine/Photonator
Objective C | 32 lines | 22 code | 10 blank | 0 comment | 0 complexity | 574f78db6e5afabfa0565e3dd9dba6f0 MD5 | raw file
 1%%
 2
 3
 4num_photons = 1e3;
 5scattering_events = 1; 
 6n_water = 1.33;                     % index of refraction of water
 7
 8c = 2.675;
 9a = 0.535;
10
11[cdf_scatter,angle] = generate_scatter('measured','maalox_alan');
12
13receiver_x = 0.1;                     % X position of the receiver (in meters)
14
15init_angle = 0; %atan(3.66/receiver_x)      
16init_angle2 = 0     
17
18rec_pos = [0,0;1,1];    % y,z location of receiver
19rec_aperture = [3;3];   % aperture diamter in meters
20rec_fov = [90;20].*(pi/180);    % field of view (in degrees)
21
22diverg = 0.01*pi/180;
23
24[total_time,total_rec_power,total_rec_packets,rec_loc_final,total_rec_dist] = ...
25    mc_func_r4(num_photons,scattering_events,c,a,receiver_x,cdf_scatter,angle,init_angle,init_angle2,diverg);
26%%
27[power,ph_cnt] = mc_rec_r1(a,rec_loc_final,total_rec_dist,rec_pos,rec_aperture,rec_fov);      
28%%
29% scatter(rec_loc_final(:,1),rec_loc_final(:,2))
30% hist3([rec_loc_final(:,1),rec_loc_final(:,2)],[20,20])
31
32%%