Skip to content

Instantly share code, notes, and snippets.

@ronwnor
ronwnor / curv.js
Created October 28, 2023 08:20
bezierCurvature
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const tau = 2 * Math.PI;
const DEGREE = 9, CIRCLES = 3000;
document.body.append(canvas);
(onresize = () => {
canvas.width = innerWidth;
canvas.height = innerHeight;
@ronwnor
ronwnor / desmosound.js
Last active April 17, 2023 07:16
generate audio from functions!
{
window.AudioContext = window.AudioContext || window.webkitAudioContext;
const audioContext = new AudioContext();
const BuiltIn = require("core/math/builtin");
// returns the selected expression as a js function
const parsedSelectedExpression = () => {
// from the great fireflame
const computeContext = () => {
// Emulate what happens in the web worker
@ronwnor
ronwnor / DesmosBezierDrawingTool.js
Last active April 12, 2024 04:15
a Bézier curve drawing tool which (hopefully) makes drawing in desmos less tedious
/* ~ instructions ~
* ∙ paste this code inside the javascript console (ctrl+shift+j)
* ∙ create a new table with Alt+Q
* ∙ add a point with Alt+A
* ∙ close the shape with Alt+S. or Alt+C. or Alt+W.
* ∙ enjoy!
*/
(() => {