Given a set of 2D coordinates and radius for each coordinate how to efficiently find all the points where at least 2 circles of the set of circles intersect?
I understand two circles intersect at a maximum of 2 points so it can be done by pairwise comparisons between two circles and looping over the entire data set but when the real data set has 10000 circles, doing all the pairwise comparisons will be computationally expensive.
Below is the sample code for generating Test Data.
library("plotrix")
set.seed(1995)
XCoordinate = sample(x = 1:100,size = 20)
set.seed(2000)
YCoordinate = sample(x = 1:100,size = 20)
set.seed(1997)
Radius = sample(x = 1:50,size = 20)
## Create DataFrame
TestData = data.frame(XCoordinate = XCoordinate,YCoordinate = YCoordinate,
Radius = Radius )
## Plot Circle
plot(TestData$XCoordinate, TestData$YCoordinate,
type="n", xlab="", ylab="" , main="Test draw.circle")
for(Row in 1:nrow(TestData)){
PlotCircle(TestData$XCoordinate[Row],
TestData$YCoordinate[Row],
TestData$Radius[Row])
}
I am trying find all the points that are marked in black in the attached.
