Highly interactive visualizations of the determinant 0 surface of 3x3 matrices and the hyperdeterminant 0 surface of 2x2x2 tensors. Check them out here.
If you just want to run the website locally or hack on it a bit, that's easy too:
- clone this source using
git clone - move into the cloned directory and start a webserver with Python via
cd deter/; python -m http.server- use a web browser to open the link in the Python command's output (i.e
http://0.0.0.0:8000/orlocalhost:8000perhaps with a different number than 8000)
These visualizations are enabled by Harry Chen's Spirulae, a set of tools for interactive mathematics visualizations in the browser. This project only uses a specialized version of the 3-D implicit function visualizer, but you can see and use this and all the other Spirulae apps here
Many dependencies, extraneous functionality, and unused assets were remove in the process of specializing this code for the given visualizations.
Spirulae's various readmes cover this topic, but in four simple lines:
- parse mathematical expression for
f(x,y,z)=0from an input box - translate parsed expression for
f(x,y,z)into a sequence of simple operations like addition and multiplication in GLSL - inject the GLSL version of
finto a fragment shader which renders the implicit surface using ray marching - compile the function-specific GLSL function to WebAssembly using emscripten, and run the compiled shader on the GPU to render an image
We hijack Spirulae early in this process, essentially before the first step above.
By substituting user specified matrices/tensors in a symbolic expression, we generate an implicit mathematical function of only (x,y,z) whose zeros are those of the (hyper)determinant.
We then feed this mathematical expression into the input box behind the scenes, as well as exposing fields and options for specifying the 4 matrices/tensors defining the affine slice through the ambient space.