function from $\mathbb{R}^2$ to $\mathbb{R}$ | two-dimensional surface in $\mathbb{R}^3$ | one-dimensional curve in $\mathbb{R}^3$ |
function from $\mathbb{R}$ to $\mathbb{R}$ | one-dimensional curve in $\mathbb{R}^2$ | implicit curve in $\mathbb{R}^2$ |
The links above offer various ways to graph functions, curves, and surfaces. They were inspired by Lee Stemkoski's example code and they use MathBox by Steve Wittens as well as three.js, dat.GUI, and Matthew Crumley's JavaScript Expression Evaluator. They will currently work best on desktop computers using Chrome. Firefox should also be OK, but might sometimes be slow.
I think most of this should be rather self-explanatory, but here are some hints:
sin(x)
instead of Math.sin(x)
or 2^x
instead of Math.pow(2,x)
. (For more details see here.) The other way is to write proper JavaScript. This should only be necessary for pretty complicated functions which need temporary variables, loops, or conditional statements. (See example below.)
cos(x^3)
or return Math.cos(Math.pow(x,3))
.
The code decides how to parse your input by looking for the
keyword return
.xmin
and xmax
are
both positive, then neither the $y$ axis nor the $z$ axis are shown.xmin
value is greater than your xmax
value, it won't warn you, but you probably won't see anything interesting.createUrl
with
no arguments. It should return a URL for what you currently
see on your screen.Here are some examples (play with the parameters $a$ and $b$ if possible):
Copyright (c) 2016-2017, Prof. Dr. Edmund Weitz. Impressum, Datenschutzerklärung.