4 ms·
I once implemented rounded rectangles by drawing circles with regards to arbitrary p-norms [1,2] – I did not think about it at the time, but the derivatives are
by suyjuris 4y ago
I once implemented rounded rectangles by drawing circles with regards to arbitrary p-norms [1,2] – I did not think about it at the time, but the derivatives are probably quite nice. (It did have the advantage of using the same code for rounded rectangles and for circles.)
[1] https://en.wikipedia.org/wiki/Norm_(mathematics)#p-norm https://en.wikipedia.org/wiki/Norm_(mathematics)#p-norm
[2] https://en.wikipedia.org/wiki/Lp_space#/media/File:Vector-p-Norms_qtl1.svg https://en.wikipedia.org/wiki/Lp_space#/media/File:Vector-p-...
- aasasd 4y agoPretty sure that's how squircles are supposed to be mathematically implemented—at least in the option based on superellipses: https://en.wikipedia.org/wiki/Squircle https://en.wikipedia.org/wiki/Squircle