Skip to content

Instantly share code, notes, and snippets.

View Andrew900460's full-sized avatar

Andrew900460

View GitHub Profile
@Andrew900460
Andrew900460 / desmos_function_print.js
Last active February 25, 2026 09:23
Evalulate and Print a Large Amount Values From a Desmos Graph
// Example graph: https://www.desmos.com/calculator/q3s6iqq2cc
// This is my hacky solution to doing something that I wish was easier in Desmos.
// Ultimately, this works by calculating values in large batches through Desmos Lists, and concatenating those values into a single list.
// The biggest list size right now seems to be 10,000. So the batches are that big.
// Lastly, we take the final list of values and convert it to a giant string, and print that to the console.
// If you want to adjust how this works, take note of the 'Calc.HelperExpression' line, in particular, the latex string value.
// That latex is essentially a list of 10,000 equally spaced values positioned based on 'n', that is then fed into an f(x) function.
// So if you don't have an f(x) function in your Desmos Graph, it probably won't work.