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
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
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
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 |
OlderNewer