Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
summer_2019:gravitation [2019/08/06 02:52]
tallpaul
summer_2019:gravitation [2019/08/06 02:56] (current)
tallpaul
Line 1: Line 1:
 **Follow this link for the activity and the instructions:​ [[https://​trinket.io/​library/​trinkets/​4b1a7a7441|link]]** **Follow this link for the activity and the instructions:​ [[https://​trinket.io/​library/​trinkets/​4b1a7a7441|link]]**
 +
 +**Or, read the instructions after the image below, and copy the code into your own GlowScript file.**
  
 You should see something that looks like this: You should see something that looks like this:
  
-{{ satellite_trinket_screenshot.png?​600 | trinket screenshot}}+{{ satellite_trinket_screenshot.png?​800 | trinket screenshot}}
  
 If you click on the "​Instructions"​ tab in the upper right, a set of instructions for the activity should pop up. Click between "​Instructions"​ and "​Result"​ to alternately view the instructions and the animation. If you prefer, the same instructions are also listed below. If you click on the "​Instructions"​ tab in the upper right, a set of instructions for the activity should pop up. Click between "​Instructions"​ and "​Result"​ to alternately view the instructions and the animation. If you prefer, the same instructions are also listed below.
Line 19: Line 21:
 For more information on glowscript tools, check out: [[https://​www.glowscript.org/​docs/​GlowScriptDocs/​index.html]] For more information on glowscript tools, check out: [[https://​www.glowscript.org/​docs/​GlowScriptDocs/​index.html]]
  
-''​GlowScript 2.7 VPython+<​code>​ 
 +GlowScript 2.7 VPython
  
 # Window setup # Window setup
Line 54: Line 57:
 # Calculation Loop # Calculation Loop
 while t < tFinal: while t < tFinal:
-  ​rate(10000)+    ​rate(10000)
  
-  ​Fnet = vec(0, 0, 0)+    ​Fnet = vec(0, 0, 0)
  
-  ​pSatellite = pSatellite + Fnet * dt +    ​pSatellite = pSatellite + Fnet * dt 
-  Satellite.pos = Satellite.pos + (pSatellite / mSatellite) * dt+    Satellite.pos = Satellite.pos + (pSatellite / mSatellite) * dt
  
-  ​t = t + dt+    ​t = t + dt
   ​   ​
-  ​############​ Extra ############​ +    ​############​ Extra ############​ 
-  ## kineticGraph.plot(t,​ 0)   ## +    ## kineticGraph.plot(t,​ 0)   ## 
-  ## potentialGraph.plot(t,​ 0) ## +    ## potentialGraph.plot(t,​ 0) ## 
-  ###############################​+    ###############################​
   ​   ​
   ​   ​
-  ​########### Extra Extra ###########​ +    ​########### Extra Extra ###########​ 
-  ## FnetArrow.pos = vec(0, 0, 0)  ## +    ## FnetArrow.pos = vec(0, 0, 0)  ## 
-  ## FnetArrow.axis = vec(0, 0, 0) ## +    ## FnetArrow.axis = vec(0, 0, 0) ## 
-  ###################################​ +    ###################################​
  
- # Earth Rotation (just for fun!) +     
-  theta = 2 * pi * dt / tFinal +    ​# Earth Rotation (just for fun!) 
-  Earth.rotate(angle=theta,​ axis=vec(0, 1, 0), origin=Earth.pos) +    theta = 2 * pi * dt / tFinal 
-''​+    Earth.rotate(angle=theta,​ axis=vec(0, 1, 0), origin=Earth.pos) 
 +</​code>​
  • summer_2019/gravitation.1565059973.txt.gz
  • Last modified: 2019/08/06 02:52
  • by tallpaul