-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample 3 (3d pyramid).py
26 lines (21 loc) · 996 Bytes
/
example 3 (3d pyramid).py
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
import massspring as m
m.acceleration.x = -m.ge
m.acceleration.y = -m.ge
m.acceleration.z = -m.ge
n = 5
m.mass(m=20, r=20, x=-50, y=-50, z=0, vx=0, vy=0, vz=0, moveable=True,
solid=True, bound=True, color=m.colors.RED, visible=True)
m.mass(m=20, r=20, x=50, y=-50, z=0, vx=0, vy=0, vz=0, moveable=True,
solid=True, bound=True, color=m.colors.RED, visible=True)
m.mass(m=20, r=20, x=-50, y=50, z=0, vx=0, vy=0, vz=0, moveable=True,
solid=True, bound=True, color=m.colors.RED, visible=True)
m.mass(m=20, r=20, x=50, y=50, z=0, vx=0, vy=0, vz=0, moveable=True,
solid=True, bound=True, color=m.colors.RED, visible=True)
m.mass(m=20, r=20, x=0, y=0, z=(3**.5/2) * 100, vx=0, vy=0, vz=0,
moveable=True, solid=True, bound=True, color=m.colors.RED, visible=True)
for i in range(n):
for j in range(i+1, n):
m.spring(k=100000, nl=0,
m1=m.mass_lis[i], m2=m.mass_lis[j],
color=m.colors.GREEN, visible=True)
m.mainloop(10)