News for hackers. Stuff that matters.
Re:Calculating the intersection area of 3 or more circles by enedil on Tuesday June 30, 2015 @08:06PM (#9809181)
The method used here is quite obvious for a good-at-maths primary school student.
Re:Calculating the intersection area of 3 or more circles by function_seven on Tuesday June 30, 2015 @08:44PM (#9809305)
Agreed, though only in retrospect for me. When I first saw the problem—before I looked at any of the solutions—I found myself quickly mired down thinking about how to formulate an integral to calculate the area.

The polygon-plus-border-segments method requires no calculus. http://www.mathopenref.com/segmentarea.html

Re:Calculating the intersection area of 3 or more circles by benfrederickson on Tuesday June 30, 2015 @09:00PM (#9809385)
Once I figured out the solution, I was kicking myself for not figuring it our earlier =)

I think I went wrong in 2 ways. My first attempt was to solve using calculus, and though I came up with a solution for the 2 circle case - I totally failed at finding the integral for 3+ circles.

My bigger mistake was to google for papers after I failed initially. I looked for other peoples venn diagram solutions, and found that they were using approximation techniques to calculate. Since the people writing these papers have a much better math pedigree than I do, it made me think I should use an approximation too.

While I did waste a bit of extra time on this, most of the time was spent in writing javascript code. Since the whole point of the venn diagram library in the first place was to learn javascript, I can’t really say it was a total waste. Also I used the quad tree estimate to verify the exact solution.

Re:Calculating the intersection area of 3 or more circles by darkmighty on Tuesday June 30, 2015 @11:43PM (#9809961)
In your defense, the quadtree method is more easily generalizeable to general figures :)

But indeed I believe there's a very good generalization of the intersection method (the exact one). If you have a general curve and an algebraic description, you can find the intersections roughly using something akin to the quadtree method and then use something like Newton's method to find the precise intersections. It's root finding essentially (basic numerical analysis), you can find very general and good methods on wiki. And then once you have the intersections, you only have to compute some internal polygons and then calculate some integrals. Again, this integrals can be calculated using standard methods like Runge-Kutta. Altogether this gives a very general method with much faster convergence and lower memory (quadratic convergence versus linear convergence for quadtree, provided your boundary satisfies some not too strict conditions).

Re:Calculating the intersection area of 3 or more circles by dnautics on Wednesday July 01, 2015 @04:06AM (#9810543)
There is a simple calculus solution that is more elegant that the primary school maths solution... That is to use Green's Theorem.

https://en.wikipedia.org/wiki/Green%27s_theorem#Area_Calcula...

In fact, the algorithm for the area of the interior polygon that you are using itself (shoelace algorithm) uses green's theorem 'in stealth mode'.

Re:Calculating the intersection area of 3 or more circles by pbhjpbhj on Wednesday July 01, 2015 @07:36AM (#9811188)
Where are you? Which "good" (as opposed to exceptional) primary school students know trig?

In the UK chords aren't mentioned in the maths curriculum until KS4 (late secondary school, 14-16yo) - https://www.gov.uk/government/publications/national-curricul....