I want to calculate the area displayed in yellow in the following picture:
The red square has an area of 1
. For any given square, I'm looking for the simplest formula to compute the yellow area in this picture.
(Squares are actually pixels in an image processing software, and I need to compute the opacity of the given pixel based on the relative area of the circle compared to the area of the pixel, to create smooth rounded corners.)
Update: I need to be able to do that for any individual square in the image: also the orange and the green one, for example.