summaryrefslogtreecommitdiff
path: root/make_beam_trace.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2013-01-16 14:27:10 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2013-01-16 14:27:10 -0500
commit37d09478a8fca4e1229dcb1246c9f23f1f6118df (patch)
tree79e2d5f9179987b46b5b743c552c29f94ffb999e /make_beam_trace.m
parent28ef703f718ce7f540864ca8f9a301f8d7d3f3e0 (diff)
downloadwgmr-37d09478a8fca4e1229dcb1246c9f23f1f6118df.tar.gz
wgmr-37d09478a8fca4e1229dcb1246c9f23f1f6118df.zip
move code to directory with speaking name
Diffstat (limited to 'make_beam_trace.m')
-rw-r--r--make_beam_trace.m37
1 files changed, 0 insertions, 37 deletions
diff --git a/make_beam_trace.m b/make_beam_trace.m
deleted file mode 100644
index f62168f..0000000
--- a/make_beam_trace.m
+++ /dev/null
@@ -1,37 +0,0 @@
-function img=make_beam_trace(beam, stop_point, border_limits, img)
- % img so far beam traced part
- [Ny,Nx]=size(img);
- %% border_limits has coordinates of left bottom and right top coners
- xlb=border_limits(1);
- ylb=border_limits(2);
- xrt=border_limits(3);
- yrt=border_limits(4);
-
- %% beam start stop coordinates with respect to lower left border point
- xb1=beam.origin(1)-xlb;
- yb1=beam.origin(2)-ylb;
- xb2=stop_point(1)-xlb;
- yb2=stop_point(2)-ylb;
-
- %% beam path coordinates
- Nc=1000; % number of coordinate points
- xb=linspace(xb1,xb2, Nc);
- yb=linspace(yb1,yb2, Nc);
-
- %% beam coordinate to image pixel coordinate
- px=round(xb/(xrt-xlb)*(Nx-1) + 1);
- py=round(yb/(yrt-ylb)*(Ny-1) + 1);
-
- %% truncate to borders
- py=py( (1<=px) & (px<=Nx) );
- px=px( (1<=px) & (px<=Nx) );
-
- px=px( (1<=py) & (py<=Ny) );
- py=py( (1<=py) & (py<=Ny) );
-
- for i=1:length(px)
- img(py(i),px(i))=beam.intensity;
- end
-end
-
-