-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathL_5.py
More file actions
29 lines (28 loc) · 1.23 KB
/
Copy pathL_5.py
File metadata and controls
29 lines (28 loc) · 1.23 KB
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
import matplotlib.pyplot as opt, matplotlib.animation as animation, pathlib, random as rd
from Main import dl, intrs, animate, get_y, cl_int
data = open(str(pathlib.Path(__file__).parent.absolute())+"\Data.txt","w")
circle_s = (0, 0, 5)
otr_s = ((circle_s[0]+circle_s[2], circle_s[0]-circle_s[2]), (circle_s[1], circle_s[1]))
rp = (0, 3)
line_1 = dl(otr_s[0][0], rp[0], otr_s[1][0], rp[1])
line_2 = dl(otr_s[0][1], rp[0], otr_s[1][1], rp[1])
point_1, point_2 = cl_int(circle_s, line_2, otr_s[0][1]), cl_int(circle_s, line_1, otr_s[0][0])
line_3 = dl(otr_s[0][0], point_1[0], otr_s[1][0], point_1[1])
line_4 = dl(otr_s[0][1], point_2[0], otr_s[1][1], point_2[1])
point_3 = intrs(line_3, line_4)
line_5 = dl(rp[0], point_3[0], rp[1], point_3[1])
data.write("c "+str(circle_s)+'\n')
data.write("o "+str(otr_s)+'\n')
data.write("p "+str(rp)+'\n')
data.write("l "+str(line_2)+'\n'+"l "+str(line_1)+'\n')
data.write("p "+str(point_1)+'\n'+"p "+str(point_2)+'\n')
data.write("l "+str(line_4)+'\n'+"l "+str(line_3)+'\n')
data.write("p "+str(point_3)+'\n')
data.write("l "+str(line_5)+'\n')
data.close()
fig = opt.figure()
AnI = animation.FuncAnimation(fig, animate, interval=1000)
opt.xlim(-10, 10)
opt.ylim(-10, 10)
opt.grid()
opt.show()