elems_in_cylinder

PURPOSE ^

INCYL: calculate elements in infinite cylinder

SYNOPSIS ^

function [index_incyl,mat]=elems_in_cylinder(center_simp,origin,radius,mat,value);

DESCRIPTION ^

 INCYL: calculate elements in infinite cylinder
 [index_incyl,mat]=incyl(center_simp,origin,radius,mat,value);

 See also: mk_c2f_circ_mapping (this is the recommended function)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [index_incyl,mat]=elems_in_cylinder(center_simp,origin,radius,mat,value);
0002 % INCYL: calculate elements in infinite cylinder
0003 % [index_incyl,mat]=incyl(center_simp,origin,radius,mat,value);
0004 %
0005 % See also: mk_c2f_circ_mapping (this is the recommended function)
0006 
0007 % (C) 2005 David Stephenson. Licenced under GPL
0008 % $Id: elems_in_cylinder.m 3007 2012-06-06 13:36:42Z aadler $
0009 
0010 warning('EIDORS:deprecated',[ ...
0011 'ELEMS_IN_CYLINDER is deprecated as of 06-Jun-2012. Use MK_C2F_CIRC_MAPPING.']);
0012 
0013 index_incyl=[];
0014 a=origin(1);
0015 b=origin(2);
0016 r=radius;
0017 
0018 for i=1:size(center_simp,1);
0019 
0020    x=center_simp(i,1);
0021    y=center_simp(i,2);
0022    r_squared_calc=((x-a)^2)+((y-b)^2);
0023 
0024    if r_squared_calc <= r^2
0025       index_incyl(i,1)=1;
0026    else
0027       index_incyl(i,1)=0;
0028    end
0029 
0030    i=i+1;
0031 
0032 end
0033 
0034 for i=1:size(center_simp);
0035 
0036    if index_incyl(i,1)==1;
0037       mat(i,1)=value;
0038       i=i+1;
0039    end
0040 end

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005