4 ms·
> The distance to the circle is max(0, sqrt(x*2 + y*2) - radius) ... so as you would expect on the outside, but it's 0 on the inside That is the distance to a
by moonchild 4y ago
> The distance to the circle is max(0, sqrt(x*2 + y*2) - radius) ... so as you would expect on the outside, but it's 0 on the inside
That is the distance to a disc.
- quietbritishjim 4y agoOops you are right! That's a depressing reminder how long it's been since I was a research mathematician (when I wouldn't have made that mistake... probably). In fairness, "circle" is fairly often used to refer to the 2d shape, even sometimes in real maths contexts e.g. "squaring the circle" in classical geometry is never referred to as "squaring the disc". In fact I suspect use of "circle" to refer exclusively to the 1d boundary probably comes a very long time after the word first existed in the English language. And even when I was a research mathematician, I never would've corrected someone if it was really clear from the context that they were talking about the 2d shape (which, to be honest, is true of my comment above).