start point
unknown
python
9 months ago
550 B
7
Indexable
Web VPython 3.2
from visual import *
#constants
L0 = 8
theta0 = 10 * pi/180
g = 9.8
m = 5
anchor = sphere(pos = vec(0,0,0), radius = 0.2 , color = color.yellow)
ball = sphere(pos = anchor.pos + vec(0,-L0,0), color = color.red, mass = m, v = vec(0,0,0), radius = 0.5)
string = helix(pos = anchor.pos, axis = ball.pos - anchor.pos, radius = 0.2, color = color.orange)
ball.theta = theta0
ball.omega = 0
while t < 10:
F =
ball.p = ball.p + F*dt
ball.omega = v.tan/L0
ball.theta =
ball.pos =
Editor is loading...
Leave a Comment