3 ms·
I would love an explanation on how it works because this feels like black magic to me. If you know you have two points, one at (0, 10) and (10, 0) and drag the
by sph 3y ago
I would love an explanation on how it works because this feels like black magic to me.
If you know you have two points, one at (0, 10) and (10, 0) and drag the latter to (20, 0), how does the system tell that the first needs to be mirrored by the same distance?
Again, this is magic, so very well done to the author. Great stuff
- fouronnes3 3y agoDefine a function that measures the error between the position of the drawn element and the new position required by the drag action. Compute partial derivatives of this function with respect to the data variables. Minimize this function to find the new data values. Re-render everything with the new optimal data values. It's a bit confusing, because typically what's called 'data' here would be called "parameters" in mathematical optimization, or "weights" in statistics / machine learning. Also ML would call "data" what's fixed, so here the position of the dragged element.
- pohl 3y agoAny sufficiently advanced mathematics is indistinguishable from magic, where "sufficently advanced" turns out to be a low bar.