Skip to content

Instantly share code, notes, and snippets.

@Refath
Created September 9, 2020 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Refath/1f95dfe619f358c2f0f61df15d6bed43 to your computer and use it in GitHub Desktop.
Save Refath/1f95dfe619f358c2f0f61df15d6bed43 to your computer and use it in GitHub Desktop.
GlowScript 3.0 VPython
c = 3e8
m = 1.6e-27
E = (1.6e-19)/((8.85e-12)**2)
Q = 1.6e-19
v = 3
e0 = 8.85e-12
shader = canvas(width = 700, height = 700, background = color.white)
charge = sphere(radius = 1e10, pos = vector(0,0,0), color = color.red, make_trail=True)
time = 0
dt = 0.01
while(time <= 1000):
rate(10)
charge.pos.x = v*time
charge.pos.y = 10*(Q*E*(time**3))/(2*m)
time = time + dt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment