y = mx + b
(x - p)^2 + (mx + b - q)^2 = r^2
(1+m^2) x^2 + 2m(b-q)x - 2px + (b-q)^2+p^2-r^2 = 0
Then, determine the real solutions via the discriminant > 0
plot 4(yx - yq - p)^2 - 4(y^2 + 1)( (x-q)^2 - r^2 ) >= 0 where p = 0, q = 0, r = 1
| set xrange[1:100]; set logscale y; set yrange[1:50]; plot log(2)/log(1+x/100) | |
| set term png | |
| set output "Desktop/printme.png" | |
| replot | |
| #https://twitter.com/randompast/status/950566913985466373 |
| var len = function(v_e, a){ | |
| var t = v_e/a | |
| return 0.5 * a * t * t | |
| } | |
| len(11186, 9.8) | |
| // 1/2 * a * t * t | |
| // 1/2 * v_e^2/a | |
| gnuplot> plot ((11186-460)**2 / (9.8 * x))/(2000) |
| // Tweet (gif) : https://twitter.com/randompast/status/897526013437018114 | |
| // $ budo --live cov2.js | |
| // Attempt at local convergence to a global solution via Brachistochrone | |
| // Intro: | |
| // https://www.youtube.com/watch?v=skvnj67YGmw | |
| // https://www.youtube.com/watch?v=Cld0p3a43fU | |
| // Mathier: | |
| // http://mathworld.wolfram.com/BrachistochroneProblem.html | |
| // https://www.youtube.com/watch?v=6HeQc7CSkZs&t=22s |
| // $ budo --live cov.js | |
| // Attempt at local convergence to a global solution via Brachistochrone | |
| // http://mathworld.wolfram.com/BrachistochroneProblem.html | |
| // Needs work... | |
| document.title = "CoV Brachistocrone" | |
| var fit = require('canvas-fit') | |
| var canvas = document.body.appendChild(document.createElement('canvas')) | |
| window.addEventListener('resize', fit(canvas), false) | |
| var ctx = canvas.getContext('2d') |
| //Wow, what a great code review from a friend! | |
| // g++ -std=c++11 -W -Wall -Werror main.cpp -lncurses && ./a.out | |
| // http://www.tldp.org/HOWTO/html_single/NCURSES-Programming-HOWTO/ | |
| #include <ncurses.h> | |
| // No longer #include <vector> since nothing is using it. | |
| // #include <vector> | |
| // #include <iostream> | |
| // #include <unistd.h> |
| //Inspiration via Mathologer: https://www.youtube.com/watch?v=leFep9yt3JY&t=12m53s | |
| //Excitement via Two Minute Papers: https://www.youtube.com/watch?v=HvHZXPd0Bjs&list=PLujxSBD-JXgnqDD1n-V30pKtp6Q886x7e&index=93 | |
| document.title = "Mandlebrotch" | |
| var fit = require('canvas-fit') | |
| var canvas = document.body.appendChild(document.createElement('canvas')) | |
| window.addEventListener('resize', fit(canvas), false) | |
| var ctx = canvas.getContext('2d') | |
| //z^2 + c |
| //snippet from: https://github.com/flyinactor91/Launch-Down | |
| function particle(){ | |
| //x, vx, y, vy, t | |
| return [canvas.width/2 + (0.5 - Math.random())*2, (0.5 - Math.random())*2, | |
| 0, (0.5-Math.random())*6+8, Math.random()*500] | |
| // canvas.height/4, (0.5-Math.random())*10+15, Math.random()*500] | |
| } | |
| var arr = Array(1000) | |
| for(var i = 0; i < arr.length; i++){ |
| 1 TowerFall Ascension | |
| 2 Type:Rider | |
| 3 Circuits | |
| 4 Plague Inc: Evolved | |
| 5 Hack 'n' Slash | |
| 6 Transistor | |
| 7 Game Dev Tycoon | |
| 8 Democracy 3 | |
| 9 Sokobond | |
| 10 Ichi |
| document.title = "Blah" | |
| var fit = require('canvas-fit') | |
| var canvas = document.body.appendChild(document.createElement('canvas')) | |
| window.addEventListener('resize', fit(canvas), false) | |
| var ctx = canvas.getContext('2d') | |
| player = {} | |
| player.p = [] | |
| player.p[0] = canvas.width/2 | |
| player.p[1] = canvas.height/2 |
y = mx + b
(x - p)^2 + (mx + b - q)^2 = r^2
(1+m^2) x^2 + 2m(b-q)x - 2px + (b-q)^2+p^2-r^2 = 0
Then, determine the real solutions via the discriminant > 0
plot 4(yx - yq - p)^2 - 4(y^2 + 1)( (x-q)^2 - r^2 ) >= 0 where p = 0, q = 0, r = 1