How can I calculate center point from set of coordinates with accuracy?
For example from set of observations:
point xcoord ycoord accuracy tim
+1 for very interesting problem ... Here is my approach in C++
global tables and variables to store all needed:
const int N=5; // number of measurement circles
struct _circle { double x,y,r; _circle() { x=0; y=0; r=0.0; } } circle[N],circle0,circle1;
circle[]
- measured positionscircle0
- original real position (unknown for you)circle1
- computed more accurate positionhere are my random measurements (copy your measured values instead):
int i;
double r,a,x0,x1,y0,y1;
// set real position
circle0.x=50.0;
circle0.y=50.0;
circle0.r=25.0;
// set meassured positions
Randomize();
for (i=0;i
This is how to compute Average style position:
// compute more accurate position (average style)
circle1.x=0.0;
circle1.y=0.0;
circle1.r=circle0.r;
for (i=0;ir) circle1.r=r; // best accuracy
if (circle1.r
This is how to compute Geometry style position:
// compute more accurate position (geometry style)
x0=circle[i].x; x1=x0;
y0=circle[i].y; y1=y0;
for (i=0;ia) x0=a; if (x1a) y0=a; if (y1
And here are some previews of my code output: