Skip to content

Instantly share code, notes, and snippets.

View fenjalien's full-sized avatar
🌳

Jack fenjalien

🌳
View GitHub Profile
## Creates a gamma-corrected lookup table
import math
def gamma(nsteps, gamma):
gammaedUp = [math.pow(x, gamma) for x in range(nsteps)]
return [x/max(gammaedUp) for x in gammaedUp]
def rounder(topValue, gammas):
return [min(topValue, round(x*topValue)) for x in gammas]
@ufechner7
ufechner7 / linalg_3.py
Created April 1, 2015 11:07
Fast linear algebra for 3D vectors using numba 0.17 or newer
# -*- coding: utf-8 -*-
"""
* This file is part of FreeKiteSim.
*
* FreeKiteSim -- A kite-power system power simulation software.
* Copyright (C) 2013 by Uwe Fechner, Delft University
* of Technology, The Netherlands. All rights reserved.
*
* FreeKiteSim is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@davepape
davepape / circle.py
Created September 19, 2013 12:44
draw a circle
# circle.py
# by Dave Pape, for DMS 423
#
# draws a circle, where the points for the vertex list are computed at run-time
from math import *
from pyglet.gl import *
window = pyglet.window.Window()