Open soegaard opened 7 months ago
Thanks for this suggestion! My take on this is:
diff
), though the documentation + discoverability should definitely be improved. Users should be able to combine the above two primitives, along with variable sliders, to produce nice visualizations of the gradient.
For example, something like this: https://www.math3d.org/derivatives
Note: There is absolutely work that could be done to improve this process / make easier for users:
diff(f,X,Y)
isn't super discoverable. It's used in some of the examples, where it's mentioned that this is the total derivative (aka gradient) but I don't think any examples use it on a function from R^N -> R.diff(f,X,Y)
is a 2d vector, and plotting it in 3d is currently pretty clunky. It should be easier to use 2d vectors in 3d. (Maybe implicitly 2d vectors have 3rd component zero).Heads-up: The above improvements all sound good to me. I probably won't include them in math3d soon. Currently I'm focusing on a (backwards-compatible) rewrite of the site (https://github.com/christopherChudzicki/math3d-next)
Hi Christopher,
Due to your many hints, I have almost succeed in make a surface showing the gradient along a curve (embeded in the surface).
https://www.math3d.org/VHQkBLxps
The part that happens on the surface works fine.
The tail property of the vektor was used to glue the vector to the curve.
However, I could not figure out how to turn a two-dimensional vector from diff(f,x,y) into a three-dimensional one [with 0 as z].
How can I add a coordinate to a vector? [It's the last field in the main folder at the left.]
Then I found pdiff
in "derivatives.js" but something is wrong.
The vector in the xy-plane and the vector on the surface doesn't match.
How can I add a coordinate to a vector? [It's the last field in the main folder at the left.]
I agree this is a bit awkward. [pdff(f,x,y,1), pdfiff(f,x,y,2), 0]
is a reasonable approach. I do think this should be easier than it is.
but something is wrong. The vector in the xy-plane and the vector on the surface doesn't match.
I'm not sure what you want "the vector on the surface" to be (what you have graphed is a tangent vector to the curve c(t)
).
The gradient of the surface f(x,y)
will be a two-dimensional vector; 0
is a natural z-component.
It would be great to have "gradient" in the list of objects. Both a gradient in a fixed point as well as in a movable point would be great.
https://en.wikipedia.org/wiki/Gradient