-
Notifications
You must be signed in to change notification settings - Fork 1
/
SymmetricPoints.m
129 lines (113 loc) · 4.8 KB
/
SymmetricPoints.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
function [Symmetric_MXY Symmetric_MXZ Symmetric_MYZ Symmetric_MO]=SymmetricPoints(position,Lb,dmin)
% This function is to find four symmetric points of interest for original
% point position: N0*3 array
% Lb is the box size
% Returns the coordinates of the mirror points:
% model
% Find mirror points
for i=1:length(position(:,1))
% Symmetric_MXY(i,1)=position(i,1);
% Symmetric_MXY(i,2)=position(i,2);
% Symmetric_MXY(i,3)=-position(i,3);
%
% Symmetric_MXZ(i,1)=position(i,1);
% Symmetric_MXZ(i,2)=-position(i,2);
% Symmetric_MXZ(i,3)=position(i,3);
%
% Symmetric_MYZ(i,1)=-position(i,1);
% Symmetric_MYZ(i,2)=position(i,2);
% Symmetric_MYZ(i,3)=position(i,3);
%
% Symmetric_MO(i,1)=-position(i,1);
% Symmetric_MO(i,2)=-position(i,2);
% Symmetric_MO(i,3)=-position(i,3);
if abs(position(i,1))<=dmin/2 && abs(position(i,2))<=dmin/2 && abs(position(i,3))<=dmin/2
Symmetric_MXY=[];
Symmetric_MXZ=[];
Symmetric_MYZ=[]
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
else if abs(position(i,1))<=dmin/2 && abs(position(i,2))<=dmin/2 && abs(position(i,3))>dmin/2
Symmetric_MXY(i,1)=position(i,1);
Symmetric_MXY(i,2)=position(i,2);
Symmetric_MXY(i,3)=-position(i,3);
Symmetric_MXZ=[];
Symmetric_MYZ=[];
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
else if abs(position(i,1))<=dmin/2 && abs(position(i,2))>dmin/2 && abs(position(i,3))<=dmin/2
Symmetric_MXY=[];
Symmetric_MXZ(i,1)=position(i,1);
Symmetric_MXZ(i,2)=-position(i,2);
Symmetric_MXZ(i,3)=position(i,3);
Symmetric_MYZ=[];
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
else if abs(position(i,1))>dmin/2 && abs(position(i,2))<=dmin/2 && abs(position(i,3))<=dmin/2
Symmetric_MXY=[];
Symmetric_MXZ=[];
Symmetric_MYZ(i,1)=-position(i,1);
Symmetric_MYZ(i,2)=position(i,2);
Symmetric_MYZ(i,3)=position(i,3);
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
else if abs(position(i,1))>dmin/2 && abs(position(i,2))>dmin/2 && abs(position(i,3))<=dmin/2
Symmetric_MXY=[];
Symmetric_MXZ(i,1)=position(i,1);
Symmetric_MXZ(i,2)=-position(i,2);
Symmetric_MXZ(i,3)=position(i,3);
Symmetric_MYZ(i,1)=-position(i,1);
Symmetric_MYZ(i,2)=position(i,2);
Symmetric_MYZ(i,3)=position(i,3);
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
else if abs(position(i,1))>dmin/2 && abs(position(i,2))<=dmin/2 && abs(position(i,3))>dmin/2
Symmetric_MXY(i,1)=position(i,1);
Symmetric_MXY(i,2)=position(i,2);
Symmetric_MXY(i,3)=-position(i,3);
Symmetric_MXZ=[];
Symmetric_MYZ(i,1)=-position(i,1);
Symmetric_MYZ(i,2)=position(i,2);
Symmetric_MYZ(i,3)=position(i,3);
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
else if abs(position(i,1))<=dmin/2 && abs(position(i,2))>dmin/2 && abs(position(i,3))>dmin/2
Symmetric_MXY(i,1)=position(i,1);
Symmetric_MXY(i,2)=position(i,2);
Symmetric_MXY(i,3)=-position(i,3);
Symmetric_MXZ(i,1)=position(i,1);
Symmetric_MXZ(i,2)=-position(i,2);
Symmetric_MXZ(i,3)=position(i,3);
Symmetric_MYZ=[];
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
else if abs(position(i,1))>dmin/2 && abs(position(i,2))>dmin/2 && abs(position(i,3))>dmin/2
Symmetric_MXY(i,1)=position(i,1);
Symmetric_MXY(i,2)=position(i,2);
Symmetric_MXY(i,3)=-position(i,3);
Symmetric_MXZ(i,1)=position(i,1);
Symmetric_MXZ(i,2)=-position(i,2);
Symmetric_MXZ(i,3)=position(i,3);
Symmetric_MYZ(i,1)=-position(i,1);
Symmetric_MYZ(i,2)=position(i,2);
Symmetric_MYZ(i,3)=position(i,3);
Symmetric_MO(i,1)=-position(i,1);
Symmetric_MO(i,2)=-position(i,2);
Symmetric_MO(i,3)=-position(i,3);
end
end
end
end
end
end
end
end
end
end