-
Notifications
You must be signed in to change notification settings - Fork 0
/
np_bnd.m
37 lines (28 loc) · 797 Bytes
/
np_bnd.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function inside = np_bnd(coord)
% crude nanopore boundary function
% coord = [x,y,z]
% true inside boundary
% false outside
% Stephen Fleming
% 8/16/17
% pore radius
R = 0.6; % nm
% z location of constriction
zcon = -7; % nm
inside = true;
% nanopore only exists from z = -8 to z = 0
if coord(3) < 0 && coord(3) > -8
% z = -7 is the narrowest constriction
% from z = -8 to z = -7
if coord(3) < -7
if coord(1)^2 + coord(2)^2 >= R^2 - (coord(3)-zcon)*3*R^2
inside = false;
end
% from z = -7 to z= 0
else
if coord(1)^2 + coord(2)^2 >= R^2 + (coord(3)-zcon)*(15/7)*R^2
inside = false;
end
end
end
end