calculate part of solid circle in 2D array

Robert Voigtländer r.voigtlaender at
Mon Nov 25 08:26:19 CET 2013


I wonder if someone can help me with a function I need for programming my robot.
I want to update an 2D occupancy grid based on sonar data. The sonar “view angle” is cone shaped. So I need to calculate all cells of a 30° slice of a filled circle.
Something like this:

Using trigonometry is too expensive. I think something like Brenham’s circle algorithm would be a good candidate.
But I need it filled (that would be doable for me I think) and I don’t need the full circle but only a part of it.

I wonder if someone has a function like this lying around. If so I would be glad to not have to reinvent the wheel 

Thanks and cheers

More information about the Python-list mailing list