This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from visual import * | |
from visual.graph import * | |
gra=gcurve(color=color.cyan) | |
dj=sphere(pos=(-2,0,0), radius=0.15, color=color.red) | |
dude=sphere(pos=(0,0,0), radius=0.1, color=color.cyan) | |
dj.m=100 | |
dude.m=65 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from visual import * | |
Earth=sphere(pos=vector(0,0,0), radius =1, material=materials.earth) | |
R=2.75 #orbita radius in terms of radius of the planet | |
GM=1.47 #GM as determined from the game | |
v=sqrt(GM/R) #starting speed for a circular orbit | |
rt=0.0338 #this is the acceleration due to the rocket | |
#sc is the spacecraft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pylab import * | |
from random import * | |
n=0 | |
x1p=[0] | |
y1p=[0] | |
x1=0 | |
y1=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pylab import * | |
vx=0 | |
vy=1 | |
x=0 | |
y=0 | |
xp=[0] | |
yp=[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rom pylab import * | |
from random import * | |
def drunk(s): | |
# s is the distance the two drunks start from each other | |
n=0 | |
x1=0 | |
y1=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from visual import * | |
#import pylab as pb | |
scene2=display(background=color.white) | |
#scene2.visible=False | |
L=1. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from visual import * | |
from visual.graph import * | |
#import pylab as pb | |
# the pylab module is used for making prettier graphs | |
### These are the three curves for plotting | |
fun1=gcurve(color=color.cyan) | |
fun2=gcurve(color=color.red) | |
fun3=gcurve(color=color.yellow) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly | |
py = plotly.plotly(username='**username**', key='**put your api key here**') | |
y=0 | |
t=0 | |
dt=0.01 | |
g=9.8 | |
v=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from visual import * | |
t=0 | |
dt=0.01 | |
g=vector(0,-9.8,0) | |
ball = sphere(pos=(-1,1,0), radius=.15, color=color.cyan) | |
ball.v=vector(0.1,0,0) | |
floor=box(pos=(0,0,0), length=2, width=1, height=.1, color=color.blue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from visual import * | |
g=vector(0,-9.8,0) | |
ball=sphere(pos=(0,1,0), radius=0.05, material=materials.shiny) | |
ball.p=vector(0,0,0) | |
ball.m=0.1 | |
t=0 | |
dt=0.001 | |
floor = box(length=1, width=1, height=0.05, pos=vector(0,0,0), color=color.blue) |
OlderNewer