Let's imagine we have a plane with some points on it. We also have a circle of given radius.
I need an algorithm that determines such position of the circle that it covers maximal possible amount of points.
If there are many such positions, the algorithm should return one of them.
Precision is not important and algorithm may do small mistakes.
Here is an example picture:
Input:
int n
(n<=50) - number of points;
float x[n]
and float y[n]
- arrays with points' X and Y coordinates;
float r
- radius of the circle.
Output:
float cx
and float cy
- coordinates of the circle's center
Lightning speed of the algorithm is not required, but it shouldn't be too slow (because I know a few slow solutions for this situation)
C++ code is preferred, but not obligatory.
Thank you...