Open asukaminato0721 opened 1 year ago
Very curious issue, thanks for reporting!
Turns out it's because q5 doesn't support subtracting a scalar from a vector (yet), so change the line from this:
const f = (x) => vectorPow(x, 4).sub(1);
to this:
const f = (x) => vectorPow(x, 4).sub(createVector(1,0));
Easy to add the feature. Only concerns are that: more type checking overhead; clarity: should (1,2,3) - 1
be (0,2,3)
or (0,1,2)
? (1,2,3)*2
is not (2,2,3)
. But in the spirit of compatibility with p5 we probably should support it...
Thanks to this library, it cut the render time a lot.
https://editor.p5js.org/AsukaMinato/sketches/ftth2jRtZ
This is the newton fractal set.
By q5
by p5
Why it's not the same graph…