Skip to content
Snippets Groups Projects
Commit 3d6293c2 authored by Jason R Wilson's avatar Jason R Wilson
Browse files

files for CSA03

parent 7cde3c21
No related merge requests found
0.2928810236 1.2911361982
0.6165802564 0.269299098
-0.458071204 0.8753646784
-0.3744767324 2.3506380047
2.781976563 -0.699350887
1.7503502285 0.1733695185
0.4082673666 2.5535798298
1.6689405057 2.2200728895
-0.2311238265 1.6831750577
-2.2903534448 0.839526128
0.1310899305 -0.5120283601
-1.4126663274 1.6454021366
-0.2630980067 0.4106036932
-2.8872611974 0.7058129825
0.6725743363 0.7016039812
2.6624884711 1.0909217946
-0.8429525966 -0.3778082772
1.1857871756 -2.6386471702
1.0006002927 1.0238272177
-1.7377046336 -2.2264422141
-1.1074298945 -0.8177353743
0.4211806225 -0.3683909192
0.9186499528 -1.4802503848
-0.2021353629 -1.533446448
0.9379775368 -2.1709022919
-1.8205058299 -0.787648976
2.8587567901 -0.1880927901
2.8605665291 0.6290731185
-1.3031582245 -2.2788206327
-1.0921009236 -0.5144220329
-2.6151150219 1.1548327162
0.3996087252 -1.4076630544
0.1394883208 -2.4363569354
-1.0885862853 1.0044622798
-2.2092128256 1.2979632247
-1.2635634423 -1.900851828
0.5190776089 -2.8793547229
-1.5074811389 0.4569440065
-0.3172477283 2.0784520348
1.1968756519 -1.2153782949
1.8827869182 -0.6209655549
2.2866191827 0.4876372358
2.2904121711 1.1551895405
1.3515256789 0.0079462916
0.708092574 -0.4273877943
-2.1871556147 -1.2103060443
0.4197894642 0.5452365675
0.4459514931 0.9192049191
2.3792795751 -0.7946287797
1.8371639343 1.2233315012
-2.0250423919 0.6933573857
1.8439137524 0.4146044317
-0.5569002166 -2.5849980273
1.1845726389 -0.2787439039
1.3323335968 2.1982939556
1.3799433745 -1.9702219364
1.7621862201 -1.6564518716
-0.9278899158 2.5684877608
2.6052839875 0.6837957358
-0.6106736267 -1.7409375061
This diff is collapsed.
import sys
import numpy as np
import matplotlib.pyplot as plt
# the name of the data, hull, and output files are command line arguments
if (len(sys.argv) < 4):
print ("Command Usage: python3",sys.argv[0],"datafile","hullfile","outfile")
exit(1)
datafile = sys.argv[1]
hullfile = sys.argv[2]
outfile = sys.argv[3]
# read the data file
data = np.loadtxt(datafile)
# read the edge list
edges = np.loadtxt(hullfile,dtype='int')
# plot the data
plt.gca().set_aspect('equal')
plt.scatter(data[:,0],data[:,1],s=10,color='black')
# plot the edges
num_edges = len(edges)
for edge in edges:
p1 = data[edge[0]]
p2 = data[edge[1]]
plt.plot([p1[0],p2[0]],[p1[1],p2[1]],color='red')
# save the plot as an image
plt.savefig(outfile)
4 17
4 26
6 7
6 57
7 15
13 30
13 45
15 27
17 36
19 45
19 52
26 27
30 57
36 52
import sys
import numpy as np
import matplotlib.pyplot as plt
# the name of the data, tri, and output files are command line arguments
if (len(sys.argv) < 4):
print ("Command Usage: python3",sys.argv[0],"datafile","trifile","outfile")
exit(1)
datafile = sys.argv[1]
trifile = sys.argv[2]
outfile = sys.argv[3]
# read the data file
data = np.loadtxt(datafile)
# read the triangle list
triangles = np.loadtxt(trifile,dtype='int')
# plot the data
plt.gca().set_aspect('equal')
plt.scatter(data[:,0],data[:,1],s=10,color='black')
# plot the triangles
for triangle in triangles:
p1 = data[triangle[0]]
p2 = data[triangle[1]]
p3 = data[triangle[2]]
plt.plot([p1[0],p2[0],p3[0],p1[0]],[p1[1],p2[1],p3[1],p1[1]],linewidth=1,color='red')
# save the plot as an image
plt.savefig(outfile)
0 2 8
0 2 47
0 6 8
0 6 54
0 18 47
0 18 54
1 12 21
1 12 46
1 14 43
1 14 46
1 21 44
1 43 53
1 44 53
2 8 33
2 12 33
2 12 47
3 6 38
3 6 57
3 38 57
4 17 56
4 26 48
4 48 56
5 26 40
5 26 41
5 40 43
5 41 51
5 43 51
6 7 54
6 8 38
7 15 42
7 42 49
7 49 54
8 11 33
8 11 38
9 13 30
9 13 50
9 30 34
9 34 50
10 12 16
10 12 21
10 16 23
10 21 44
10 23 31
10 31 44
11 33 50
11 34 50
11 34 57
11 38 57
12 16 37
12 33 37
12 46 47
13 25 45
13 25 50
14 18 43
14 18 47
14 46 47
15 27 58
15 42 58
16 20 23
16 20 29
16 29 37
17 24 36
17 24 55
17 55 56
18 43 51
18 49 51
18 49 54
19 28 35
19 28 52
19 35 45
20 23 59
20 25 29
20 25 35
20 35 59
22 24 31
22 24 55
22 31 39
22 39 55
23 31 32
23 32 59
24 31 32
24 32 36
25 29 37
25 35 45
25 37 50
26 27 41
26 40 48
27 41 58
28 35 59
28 52 59
30 34 57
31 39 44
32 36 52
32 52 59
33 37 50
39 40 53
39 40 56
39 44 53
39 55 56
40 43 53
40 48 56
41 42 49
41 42 58
41 49 51
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment