Skip to content

Instantly share code, notes, and snippets.

View PhidgetMotorControl.py
"""
It's worth pointing out that python complex numbers are great for storing positions,
sizes, momentum, and polar/rect calculations. See the cmath module for details.
"""
from random import random
import sys
import math
from cmath import polar, rect
View myglcube.py
#!/usr/bin/env python
"""Draw a cube on the screen. every frame we orbit
the camera around by a small amount and it appears
the object is spinning. note i've setup some simple
data structures here to represent a multicolored cube,
we then go through a semi-unopimized loop to draw
the cube points onto the screen. opengl does all the
hard work for us. :]
"""
@gahooa
gahooa / sinewave.py
Last active Feb 13, 2018
PyOpenGL Sine Wave
View sinewave.py
#!/usr/bin/env python
###############################################################################
# Action Happens Here 50 times per second
def tick(i):
#glRotatef(1, 0, 0, 1)
#glTranslatef(0, 0, 1)
@gahooa
gahooa / vis.py
Created Feb 15, 2018
vispy sinewave
View vis.py
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Demonstration of InfiniteLine visual.
"""
import sys
import numpy as np
@gahooa
gahooa / wordfind.py
Last active Mar 12, 2018
A quick demo of a word find solver
View wordfind.py
board = '''
m a i n v f
a n a f d d
s m i t h a
i r o n r v
e m o z a i
a e e t a d
'''