This file contains hidden or 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
#!/usr/bin/python | |
# Example using a character LCD connected to a Raspberry Pi or BeagleBone Black. | |
import time | |
import Adafruit_CharLCD as LCD | |
import Adafruit_CharLCD as LCD | |
import turtle | |
import random | |
from math import sqrt | |
from gpiozero import Button |
This file contains hidden or 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.plotly as py | |
from plotly.graph_objs import * | |
from random import * | |
from pylab import * | |
py.sign_in("yourusername", "plotlykey") #you need a plotly account | |
def flip(N,lose,win): |
This file contains hidden or 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 * | |
vt=54 | |
g=9.8 | |
K=2.24 | |
m=68 | |
y=0 | |
t=0 |
This file contains hidden or 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.plotly as py | |
from plotly.graph_objs import * | |
from pylab import * | |
from visual import vector, norm, mag | |
#you need to add your own plot.ly credentials here | |
#py.sign_in(###########) | |
#electric constant | |
k=9e9 |
This file contains hidden or 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 visual import vector, dot, mag | |
## mark out the pitch | |
xlist=linspace(0,50.0,500) | |
ylist=linspace(-35.0, 35.0, 350) | |
X,Y = meshgrid(xlist, ylist) |
This file contains hidden or 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 * | |
## Setting up graphs for three of the cars | |
fun1=gcurve(color=color.cyan) | |
fun2=gcurve(color=color.yellow) | |
fun3=gcurve(color=color.red) | |
### |
This file contains hidden or 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 * | |
#graph1 = gdisplay(title='Vertical Position vs. Time', xtitle ='t (sec)', ytitle ='y (m)', background=color.white) | |
#funct1=gcurve(color=color.white) | |
#floor = box (pos=(0,0,0), length=.4, height=0.05, width=.4, color=color.blue) | |
L = 120 | |
theta0 = -pi/2 | |
#ball2=sphere() |
This file contains hidden or 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 * | |
fun1=gcurve(color=color.red) | |
fun2=gcurve(color=color.blue) | |
fun3=gcurve(color=color.yellow) | |
car1=box(pos=(-0.25, 0, 0), height=0.05, width=0.05, length=0.12, color=color.red) | |
car2=box(pos=(0.1, 0, 0), height=0.05, width=0.05, length=0.12, color=color.blue) |
This file contains hidden or 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 random import * | |
print(uniform(2.2,4.4)) | |
#ball1=sphere() | |
n=50 | |
i=0 |
This file contains hidden or 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 * | |
stick=box(pos=(0,0,0), length=1, width=.2, height=.2, color=color.cyan) | |
w=.5 | |
t=0 | |
dt=0.01 | |
while True: |
NewerOlder