Something went wrong. Try again.
[PRE-ALPHA] an open source web-based 2D/3D graphing calculator cartesium.org
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#!/usr/bin/env bashset -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"cd "$repo_root"
mkdir -p output
render() { local name="$1" local expr="$2" local x_min="$3" local x_max="$4" local y_min="$5" local y_max="$6" local width="$7" local height="$8" local out="output/${name}.svg"
cargo run --quiet -p cartesium-cli -- render-svg \ --expr "$expr" \ --x-min "$x_min" --x-max "$x_max" \ --y-min "$y_min" --y-max "$y_max" \ --width "$width" --height "$height" \ > "$out"
printf '%s\n' "$out"}
render "explicit-sine" "sin(x)" -10 10 -2 2 800 400render "explicit-sinc" "sin(pi*x)/(pi*x)" -10 10 -0.3 1.1 600 400render "explicit-quadratic" "y = x^2" -4 4 -1 10 600 500render "explicit-reciprocal" "y = 1 / x" -10 10 -6 6 1000 600render "explicit-tangent" "tan(x)" -8 8 -6 6 800 600render "explicit-high-frequency" "sin(20*x)" -2 2 -1.5 1.5 800 400render "explicit-damped-wave" "sin(8*x) / (1 + x^2)" -6 6 -1.2 1.2 800 400render "explicit-domain-boundary" "sqrt(4 - x^2)" -3 3 -1 3 600 400render "explicit-log-oscillation" "sin(1 / ln(x))" -0.001 2 -1.2 1.2 900 450render "explicit-catenary" "cosh(x)" -4 4 -1 12 700 500render "explicit-tanh" "tanh(x)" -6 6 -1.5 1.5 700 400
render "parametric-circle" "(cos(t), sin(t)) {0 <= t <= 2*pi}" -2 2 -2 2 500 500render "parametric-ellipse" "(2*cos(t), sin(t)) {0 <= t <= 2*pi}" -2.5 2.5 -1.5 1.5 700 420render "parametric-lissajous" "(sin(3*t), sin(4*t)) {0 <= t <= 2*pi}" -1.5 1.5 -1.5 1.5 600 600render "parametric-lissajous-3-2" "(sin(3*t), sin(2*t)) {0 <= t <= 2*pi}" -1.5 1.5 -1.5 1.5 600 600render "parametric-spiral" "(t*cos(t), t*sin(t)) {0 <= t <= 6*pi}" -20 20 -20 20 700 700render "parametric-astroid" "(cos(t)^3, sin(t)^3) {0 <= t <= 2*pi}" -1.25 1.25 -1.25 1.25 600 600render "parametric-butterfly" "(sin(t) * (exp(cos(t)) - 2*cos(4*t) - sin(t/12)^5), cos(t) * (exp(cos(t)) - 2*cos(4*t) - sin(t/12)^5)) {0 <= t <= 12*pi}" -4 4 -3 5 700 700
render "implicit-ellipse" "x^2 + 3*y^2 = 1.5" -2 2 -2 2 400 400render "implicit-hyperbola" "x^2 - y^2 = 1" -3 3 -2 2 600 400render "implicit-xy-reciprocal" "x*y = 1/(2*sqrt(2))" -3 3 -2 2 600 400
render "implicit-crossing-lines" "x^2 - y^2 = 0" -3 3 -3 3 600 600render "implicit-parabola" "y - x^2 = 0" -3 3 -1 5 600 600render "implicit-shifted-circle" "(x - 1)^2 + (y + 0.5)^2 = 1" -2 4 -3 2 600 500render "implicit-lemniscate" "(x^2 + y^2)^2 = x^2 - y^2" -2 2 -1.5 1.5 600 450render "implicit-folium" "x^3 + y^3 = 3*x*y" -2 3 -2 3 600 600render "implicit-trig-waves" "sin(x) + cos(y) = 0" -8 8 -8 8 800 800render "implicit-sinxy-grid" "sin(x*y) = 0" -8 8 -8 8 800 800render "implicit-no-solution" "x^2 + y^2 = -1" -2 2 -2 2 400 400