triangulate center point with accuracy from set of coordinates

前端 未结 1 1362
广开言路
广开言路 2021-01-14 16:14

How can I calculate center point from set of coordinates with accuracy?

For example from set of observations:

point   xcoord  ycoord  accuracy    tim         


        
1条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 16:41

    +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 positions
    • circle0 - original real position (unknown for you)
    • circle1 - computed more accurate position

    here 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
    • chose what accuracy radius you want in two last ifs ...
    • position is based on average of all measured ones

    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
    • position is center of occupied area

    And here are some previews of my code output:

    accuracy overlap

    0 讨论(0)
提交回复
热议问题