I need the black part size of this image:

I did some research on how to find it in ordinary math, and I was pointed to this site: Website
The final answer to this was 
(from MathWorld - Wolfram web resource: wolfram.com )
where r is the radius of the first circle, R is the radius of the second circle, and d is the distance between the two centers.
The code I tried to use to get its size was as follows:
float r = getRadius1(); float R = e.getRadius1(); float deltaX = Math.abs((getX() + getRadius()) - (e.getX() + e.getRadius())); float deltaY = Math.abs((getY() + getRadius()) - (e.getY() + e.getRadius())); float d = (float) Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)); float part, part2, part3; //Chopping it in parts, because it easier. part = (float) (Math.pow(r,2) * Math.acos( Math.toRadians((Math.pow(d, 2) + Math.pow(r, 2) - Math.pow(R, 2))/(2*d*r)))); part2 = (float) (Math.pow(R,2) * Math.acos( Math.toRadians((Math.pow(d, 2) + Math.pow(R, 2) - Math.pow(r, 2))/(2*d*R)))); part3 = (float) (0.5 * Math.sqrt((-d + r + R) * (d+rR) * (d-r+R) * (d+r+R))); float res = part + part2 - part3; Main.log(res + " " + part + " " + part2 + " " + part3+ " " + r + " " + R + " " + d); //logs the data and System.out it
I did some testing and the result was this:
1345.9663 621.6233 971.1231 246.78008 20.0 25.0 43.528286
So, this indicates that the size of the overlapping part was larger than the circle itself (i.e. r^2 * PI ).
What have I done wrong?
source share