Just updated the two-resistor divider calculator to make the interface nicer (and the underlying code cleaner). Will update the three-resistor one after I do my taxes.
Thanks, T3sl4co1l, for the links. I think jansson's is the closest to the design goals that I have for these calculators.
1. Find optimal dividers using resistor values that can be purchased
2. Calculator is a single file that can run locally on most computers
3. Ability to target minimum, nominal, or maximum ratio over resistor tolerance
4. Ability to limit results based on string resistance
5. Calculator interface contains all info required to use it
6. Results are computed quickly (< 1 second)
I had previously made a brute force program that solved two and three resistor dividers in various configurations, but it was command line based and written in python (three resistor case was slow). Rewriting in C++ gave a 30x speedup, but I wanted to use it at work and thought that program would be too difficult to explain or share if someone else wanted to use it. I realized that web technologies could solve both the portability and usability problems of a command line program, while still running locally. Learning to use JavaScript, CSS, SVG, etc. has been quite fun.
The spreadsheet output is a response to a feature request from a coworker. He wanted the calculator to compute quiescent current for the dividers. Since that requires information not related to the resistors themselves, I figured he could compute whatever he wanted if I added spreadsheet output. I would have left it at .csv, but I wrote a .docx report generator at a previous job and have wanted to figure out .xlsx spreadsheet generation ever since (they are both part of Office Open XML).
"Also didn't realize what's involved in creating (or conversely, parsing) an XLSX, interesting."
There are two ways to look at this:
1. XLSX is just some .xml files in a .zip archive. Put what you want in Excel, unzip it, and automate the parts that can change.
2. Read the ECMA376 standard; it's 6045 pages of interesting
https://www.ecma-international.org/publications/standards/Ecma-376.htmI did enough of (2) to make (1) efficient, and to be able to only keep in what I needed (e.g. not the standard office themes). ECMA376 is so long because it covers .docx, .xslx, .pptx, the markup for drawings in Office, and some other shared features. It's well organized and helpful and contains the unintentionally hilarious phrase "End of informative text."