Friday, April 15, 2005

Calculating number of dies in the water with certain area

Hand calculation

Determine the maximum square in the given circle, and get the integer number of the dies. For the rest part of the circle, take care of the exterior points, check them whether inside the circle by using x0^2+y0^2 >=< r^2.

Programming

Firstly get the points in the NE part within the minimum square including the given circle, and count the number of the points satisfying the inequation x0^2+y0^2 <= r^2. The total number is four times of the above number.

0 Comments:

Post a Comment

<< Home