|laziness, impatience, and hubris|
Re: circular area in a coordinates grid (AoA)by LanX (Cardinal)
|on Mar 19, 2019 at 22:18 UTC||Need Help??|
I understand your problem as a classic fill circle with pixels problem.
In computer graphics in the age before specialized graphic processors they used very fast algorithms giving you the edges of a circle for each line and filled that line between the edges.
Since the second level array in your AoA you just need the indices of left and right border. And an array slice will fill it effectively.
@line[$left..$right] = ('x') X ($right-$left)
You'll also need a max and min against the start of the borders of your array.
I don't think a highly optimized algorithm to calculate the border is necessary, basic sinus and cosinus should be fast enough here.
After thinking it through you don't even need sinus. Pythagoras should do already.