资源简介
用该工具箱可以计算10分1波长到10被波长的粒子的光散射导致的光钳力。Matlab程序编的超有水平。
代码片段和文件信息
function [thetaphi] = angulargrid(nthetanphibehaviour)
% angulargrid.m - makes a grid of point in theta and phi
%
% Usage:
% [thetaphi] = angulargrid(n); [n = ntheta = nphi]
% [thetaphi] = angulargrid(nthetanphi);
% [thetaphi] = angulargrid(nthetanphibehaviour);
%
% The default behaviour is that theta and phi are returned as
% column vectors of the points.
%
% Use behaviour to control the output type:
%
% behaviour | output
% -----------------------------------------------
% 0 | column vectors of all points
% 1 | vectors of all theta and phi values
% 2 | ntheta x nphi matrix of all points
%
% Note that the output data values are the same for
% behaviours 0 and 2; they‘re just arranged differently.
% To convert from one format to another:
% 2 -> 0: theta = theta(:); phi = phi(:);
% 0 -> 2: theta = reshape(thetanthetanphi);
% phi = reshape(phinthetanphi);
%
% This file is part of the package Optical tweezers toolbox 1.0
% Copyright 2006 The University of Queensland.
% See README.txt or README.m for license and details.
%
% http://www.physics.uq.edu.au/people/nieminen/software.html
switch nargin
case 1
nphi = ntheta;
behaviour = 0;
case 2
behaviour = 0;
otherwise
% Everything has been specified
end
% theta goes from 0 to pi - we avoid the endpoints
% since they are mathematically troublesome
theta = ((1:ntheta)-0.5)/ntheta * pi;
% phi goes from 0 to 2*pi 0 = 2*pi
phi = ((1:nphi)-1)/nphi * 2*pi;
if behaviour == 1
% All we need are the vectors of the theta and phi values
return
end
theta = theta.‘ * ones(1nphi);
phi = ones(ntheta1) * phi;
if behaviour == 2
return
end
theta = theta(:);
phi = phi(:);
return
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1705 2008-01-08 03:06 angulargrid.m
文件 1217 2008-01-08 03:06 bsc_plane.m
文件 4372 2008-01-08 03:06 bsc_pointmatch_farfield.m
文件 4378 2008-01-08 03:06 bsc_pointmatch_focalplane.m
文件 998 2008-01-08 03:06 calc_rotation_matrix.m
文件 2138 2008-01-08 03:06 change_nmax.m
文件 849 2008-01-08 03:04 CHANGES.txt
文件 683 2008-01-08 03:06 combined_index.m
文件 418 2008-01-08 03:06 example_cube.m
文件 4575 2008-01-08 03:06 example_gaussian.m
文件 418 2008-01-08 03:06 example_landscape.m
文件 4602 2008-01-08 03:06 example_lg.m
文件 1548 2008-01-08 03:06 example_spring_constant.m
文件 3256 2008-01-08 03:06 find_axial_equilibrium.m
文件 3735 2008-01-08 03:06 forcetorque.m
文件 1887 2008-01-08 03:06 force_z.m
文件 459 2008-01-08 03:06 iseven.m
文件 445 2008-01-08 03:06 isodd.m
文件 451 2008-01-08 03:06 ka2nmax.m
文件 598 2008-01-08 03:06 lgmode.m
文件 1376 2008-01-08 03:06 lgmodes.m
文件 1785 2008-01-08 03:06 lg_mode_w0.m
文件 713 2008-01-08 03:06 make_beam_vector.m
文件 1147 2008-01-08 03:06 matchsize.m
文件 517 2008-01-08 03:06 nmax2ka.m
文件 1165 2008-01-08 03:06 nm_cube.m
文件 1045 2008-01-08 03:06 perpcomponent.m
文件 5376 2008-01-08 03:06 README.m
文件 5042 2008-01-08 02:53 README.txt
文件 1100 2008-01-08 03:06 rotation_matrix.m
文件 988 2008-01-08 03:06 rtp2xyz.m
............此处省略19个文件信息
评论
共有 条评论