http://qs321.pair.com?node_id=1231458


in reply to circular area in a coordinates grid (AoA)

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.

HTH! :)

Edit

After thinking it through you don't even need sinus. Pythagoras should do already.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice