4 ms·
Author here. I wrote this post a while back, but never submitted to HN. Its one of those posts that I wasn't sure if it would really resonate with anyone (like
by benfrederickson 11y ago
Author here. I wrote this post a while back, but never submitted to HN. Its one of those posts that I wasn't sure if it would really resonate with anyone (like my most recent one on venn diagram layout algorithms).
Anyways, If you have any questions ask away =).
- jerf 11y agoYou may want to consider adding a note at the top clearly specifying the problem and challenging the reader to come up with an exact solution before proceeding on. It was actually an interesting problem for someone who has not been in high school geometry for 20 years. So simple to specify, yet very much a "whaaaaaaaa" moment there for a moment while I had to reload some stuff in my brain I had not accessed in a long time. A very nice "bite size" math challenge.
- bite_victim 11y agoBut isn't the title enough: "Calculating the intersection area of 3 or more circles"? What else do we need besides some numbers for the radius(es), x,y center coordinates etc? (I haven't visited the page and will try to see if I can find the solution on my own)
- bradleyland 11y agoMy mind immediately jumped to the polygon & arc solution, but I was really impressed by how you gutted this one out. As a hiring manager, you need to know that the people you hire can work through problems that are obvious to them, but more importantly, that they can work through problems that are non-obvious to them as well. Kudos for illustrating this ability.
- shuzchen 11y agoI notice that when you're trying to calculate whether a point (p) is in a circle (c) you use euclidean distance: Math.sqrt((p.x - c.x) ^ 2 + (p.y - c.y) ^ 2) > c.radius If you're doing this test many, many times (especially as in a Monte Carlo simulation), it'd be more efficient to use distanceSquared: (p.x - c.x) ^ 2 + (p.y - c.y) ^ 2 > c.radius ^ 2 Not having to calculate square roots will cut the compute time drastically.
- benfrederickson 11y agogood point! I actually used this technique recently, to speed up a numerical optimization for laying out venn diagrams: http://www.benfrederickson.com/better-venn-diagrams/ http://www.benfrederickson.com/better-venn-diagrams/ I didn't think of it when I was writing this post though =(
- willcodeforfoo 11y agoNot related to this specific post but just wanted to chime in and say all of your stuff is really great, love the visualizations! Thanks and keep up the good work.
- clebio 11y agoI really like your blog and have cloned some of the code in the past. Yet, I wonder why this article was posted now (it's from 2013, no?). HN is normally so adamant about recent content, but yeah, I love this article and several of the others. Thanks again!
- darklajid 11y agoI'm currently looking at different problems - and look for papers. I'm curious: Did you research the initial papers by feeding google with potential keywords for freely accessible files or did you buy a subscription/access to these things instead? I just recently found a paper on ieee.org that seems to be 4 pages, costs > 30 Dollar to access. Is that something you did in your research?
- bnegreve 11y agoKeep in mind that you can always ask the authors. Personally, i'm always happy to send paper / code when someone asks.