-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfindIcosahedronVertices.m
executable file
·57 lines (33 loc) · 1.55 KB
/
findIcosahedronVertices.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
function [icosaVertices, indexOfThePentagonTriangle] = findIcosahedronVertices()
disp(' - finding the vertices of icosahedron....');
[X, ~, ~] = readVlonVlatVertices();
[vX, vY, vZ] = readVlonVlat();
[cX, cY, cZ] = readClonClatVertices();
[~, col] = size(X);
pentagonsCoordinatesX = [];
pentagonsCoordinatesY = [];
pentagonsCoordinatesZ = [];
icosaVerticesX = [];
icosaVerticesY = [];
icosaVerticesZ = [];
icosaVertices = {};
indexOfThePentagonTriangle = [];
for i = 1:col
if X(end,i) == X(end-1,i)
icosaVerticesX = [icosaVerticesX; vX(i)];
icosaVerticesY = [icosaVerticesY; vY(i)];
icosaVerticesZ = [icosaVerticesZ; vZ(i)];
temp= [];
for j = 1: size(cX,2)
if sum(cX(:,j)== vX(i))==1
pentagonsCoordinatesX = [pentagonsCoordinatesX, cX(:,j)];
pentagonsCoordinatesY = [pentagonsCoordinatesY, cY(:,j)];
pentagonsCoordinatesZ = [pentagonsCoordinatesZ, cZ(:,j)];
temp = [temp; j];
end
end
indexOfThePentagonTriangle = [ indexOfThePentagonTriangle , temp];
end
end
icosaVertices = {icosaVerticesX; icosaVerticesY; icosaVerticesZ};
end