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 pprint import pprint | |
def poly_from_coefficients(coefs): | |
def poly(x): | |
p = 0 | |
for i, coef in enumerate(coefs): | |
p += coef * x ** i | |
return p | |
return poly |
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
alphabet = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
def poly_from_coefficients(coefs): | |
def poly(x): | |
p = 0 | |
for i, coef in enumerate(coefs): | |
p += coef * x ** i | |
return p | |
def poly_prime(x): |
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
let test = new TuplePendulum({N: 4, thetas:[1, 2, 3], omegas:[0.1,0.2,0.3]}) | |
var nPendulums = 5 | |
var pendulums = d3.range(nPendulums).map(x => new TuplePendulum({N: 2**x, thetas: [0.5 * Math.PI]})) | |
var fadeBackground = false; | |
var svg = d3.select("svg") | |
width = +svg.attr("width"), |
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
var nPendulums = 20; | |
var pendulums = d3.range(nPendulums).map(x => new Pendulum({theta1: 0.75 * Math.PI + 0.00001*x/nPendulums})) | |
var fadeBackground = true; | |
var svg = d3.select("svg") | |
width = +svg.attr("width"), | |
height = +svg.attr("height"), | |
g = svg.append("g").attr("transform", "translate(" + width*.5 + "," + height*.5 + ")"); |
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
var nPendulums = 60; | |
var pendulums = d3.range(nPendulums).map(x => new Pendulum({m2: 1 + 0.01*x/nPendulums, theta1:0.75*Math.PI})) | |
var fadeBackground = true; | |
var svg = d3.select("svg") | |
width = +svg.attr("width"), | |
height = +svg.attr("height"), |
We can't make this file beautiful and searchable because it's too large.
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
,STNID,min_temp,max_temp,annual_precipitation,Latitude,Longitude,Name,FIPS_COUNTY,COUNTY_NAME,AVG_WEEKLY_WAGE | |
0,USC00010063,28.5,90.1,58.24,34.2553,-87.1814,ADDISON,01133,"Winston County, Alabama",721 | |
1,USC00010160,31.4,90.9,55.62,32.9453,-85.9481,ALEXANDER CITY,01123,"Tallapoosa County, Alabama",645 | |
2,USC00011324,25.8,91.7,53.66,32.8236,-85.6561,CAMP HILL 2NW,01123,"Tallapoosa County, Alabama",645 | |
3,USC00010178,31.0,92.7,56.17,33.1272,-88.155,ALICEVILLE,01107,"Pickens County, Alabama",735 | |
4,USC00010252,31.9,91.8,59.97,31.3072,-86.5225,ANDALUSIA 3 W,01039,"Covington County, Alabama",693 | |
5,USC00010260,26.4,89.8,57.93,34.9092,-87.2747,ANDERSON,01077,"Lauderdale County, Alabama",674 | |
6,USC00010369,29.4,89.9,58.15,33.2942,-85.7789,ASHLAND 3 ENE,01027,"Clay County, Alabama",661 | |
7,USC00010390,29.8,90.2,56.89,34.7753,-86.9508,ATHENS,01083,"Limestone County, Alabama",917 | |
8,USC00010655,27.3,91.2,53.21,34.6908,-86.8825,BELLE MINA 2 N,01083,"Limestone County, Alabama",917 |
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
Array.prototype.scalarMultiply = function(x) { return this.map(function(d) { return x * d; }); } | |
var l1 = 1, l2 = 1, | |
m1 = 1, m2 = 1, | |
G = 9.8; | |
var theta1 = 0.49*Math.PI, | |
theta2 = 1.0*Math.PI, | |
p1 = 0, | |
p2 = 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
function generateTransformations(T, n) { | |
let T_n = {scale:1, angle:0, t_x:0, t_y:0}; | |
let matrices = [T_n]; | |
for (let i = 0; i < n; i++) { | |
T_n = composeTransformations(T_n, T) | |
matrices.push(T_n); | |
} | |
return matrices | |
} |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
background: black; | |
} | |
.square { | |
fill: none; | |
fill-opacity: 0.75; | |
/*stroke-opacity: 0.1;*/ |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
background: black; | |
} | |
.square { | |
fill: none; | |
stroke-width: 1.5px; | |
} |
NewerOlder