I want to write an algorithm which calculates the following:
Find all squares $(x_0,y_0,x_1,y_1)$ which are "in" the square $(0,0,1,1)$ and are divided by the unit circle so that their inner area dived by their whole area match $\frac{\pi}{4}$.
Has anyone a hint on how to solve this efficiently? Is there an image which shows an finite solution for lets say $500$ of these rectangles I'm looking for?
Note: The squares must have parallel sided with the axis.
PS: I Just want to draw a nice Image according to some rules ^^.
There are many of them. The easiest set to see is to draw a square with its center on the line from $(0,0)$ to $(1,1)$ and the corners on the circle. This would be rect(a,a,b,b) with $a^2+b^2=1$ You can just choose $a$ anything up to $\frac {\sqrt 2}2$ and compute $b=\sqrt{1-a^2}$
Another family can be found by taking a horizontal line segment that is above the circle, say $(\frac 14,\frac {31}{32})$ to $(\frac 12,\frac {31}{32})$. If you make a very thing rectangle below this, it will have no area inside the circle. You can move the lower edge down until you ratio achieves the desired $\frac \pi 4$ It takes a bit of integration to find the lower edge. Looking at the picture below, the rectangle is rect$(\frac 14,h,\frac12,\frac{31}{32})$ The total area is $\frac {31/32-h}4$ The area under the circle all the way down to the axis is $\int_{1/4}^{1/2} \sqrt{1-x^2} dx = (12 \sqrt3-3 \sqrt{15}+8 \pi-48 \arcsin(1/4))/96 \approx 0.23093$ so we choose $h$ so that $0.23093-\frac h4=\frac \pi 4(\frac {31/32-h}4)$
Added after comment: You can do the same thing with squares. You can essentially take a small square, start with it inside the circle, then slide it left or up until the area outside the circle is right. As long as you don't start too close to the right or top edge it won't poke out of rect(0,0,1,1). So in my diagram, you have a square that is $1/4$ on a side, with an area of $1/16$. Now the top edge is at $h+1/4$, not fixed at $31/32$. Choose $h$ so that the area inside the circle is $\pi/64$. It would be $0.23093-\frac h4=\frac \pi {64}$, which gives $h=0.72737$ and make sure $h+\frac 14 \lt 1$ so the small square doesn't go out of the big square-it doesn't.