⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opt_exempel.htm

📁 Matlab实现光线跟踪算法
💻 HTM
字号:
<HTML>                                              <HEAD>                                                <TITLE>/</TITLE>                                    <META NAME="GENERATOR" CONTENT="HTML-TOOLBOX ">   </HEAD>                                             <BODY bgcolor="#FFFFF0"> <HR WIDTH="100%"></P> <CENTER><P><FONT COLOR="#000000"><FONT SIZE=+3>Cross-linked m-file</FONT></FONT></P></CENTER> <CENTER><P><FONT COLOR="#000000"><FONT SIZE=+1></FONT></FONT></P></CENTER> <CENTER><P><FONT COLOR="#000000"><FONT SIZE=+2>opt_exempel.m</FONT></FONT></P></CENTER> <CENTER><P><FONT COLOR="#000000"><FONT SIZE=+1>Located in:</FONT></FONT></P></CENTER> <CENTER><P><FONT COLOR="#000000"><FONT SIZE=+1>/home/bjorn/matlab/Optical_bench</FONT></FONT></P></CENTER> <P><HR WIDTH="100%"></P> <P><HR WIDTH="100%"></P> <P><FONT COLOR="#000000"><FONT SIZE=+1>m-files called by opt_exempel.m</FONT></FONT></P> <UL> <LI><A HREF ="opt_trace.htm">opt_trace</A></LI> <LI><A HREF ="opt_plotoptics.htm">opt_plotoptics</A></LI> <LI><A HREF ="opt_build.htm">opt_build</A></LI> <LI><A HREF ="opt_screen.htm">opt_screen</A></LI> <LI><A HREF ="opt_ray.htm">opt_ray</A></LI> </UL> <P><HR WIDTH="100%"></P> <P><FONT COLOR="#000000"><FONT SIZE=+1>All the cross references in the source m-code of opt_exempel.m</FONT></FONT></P> <pre> % Set the options for ploting of the optics/raytracing opt_ops.plotrays=1; % plot the individual rays opt_ops.plotpaus=0; % do not pause after each  ray intersection opt_ops.plotRT = 0; % do not ``drawnow'' after each ray intersection  % build the optical system as specified in opt.exmpl optelements = <A HREF ="opt_build.htm">opt_build</A>('opt.exmpl');  % make a default ray ray = <A HREF ="opt_ray.htm">opt_ray</A>;  %make 100 paralell rays with random displacement in y-z plane nr_rays = 100; for ray_i = 1:nr_rays,    rays(ray_i) = ray;   rays(ray_i).r = [-3 -1.5+3*rand -1.5+3*rand];   rays(ray_i).color = rand([3 1]); % color is line color for                                    % plotting of rays  end  clf subplot(2,2,1) % plot the optical system <A HREF ="opt_plotoptics.htm">opt_plotoptics</A>(optelements([1:end-4 end])); hold on % trace all rays [opt_screen] = <A HREF ="opt_trace.htm">opt_trace</A>(optelements([1:end-4 end]),rays,opt_ops); view(-15,75)  subplot(2,2,2) % Last element should be a screen, which stores the image. imagesc(opt_screen(end).img) axis([245 265 245 265])  subplot(2,2,3) ray.r = [-3 -1 0]; <A HREF ="opt_plotoptics.htm">opt_plotoptics</A>(optelements); hold on [opt_screen] = <A HREF ="opt_trace.htm">opt_trace</A>(optelements,ray,opt_ops); view(-15,75) subplot(2,2,2) subplot(2,2,4) ray.r = [-3 0 0]; [opt_screen] = <A HREF ="opt_trace.htm">opt_trace</A>(optelements([end-1 end]),ray,opt_ops); view(0,90) </pre> <P><HR WIDTH="100%"></P> <P><I><FONT COLOR="#0000FF"><FONT SIZE=+1>Written by  B. Gustavsson 13:27 29/1 2003 <IMG SRC = "file:/home/bjorn/matlab/Local/Tools/htmltool/gifs/copyright.gif" ></FONT></FONT></I></P> <P><I><FONT COLOR="#0000FF"><FONT SIZE=+1>E-mail:</B><A HREF = "mailto:bjorn@irf.se">bjorn@irf.se</A></H4></FONT></FONT></I></P> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -