Reputation: 923
I have some set of (x,y) data. Plotting this in python simply gives
I want to be able to fit some lines or contours to this data, defining the inner and outer radii, such that I can then randomly select a point within those limits.
However, I have no idea where to even start. Any ideas?
Upvotes: 0
Views: 54
Reputation: 8067
If that are concentric circles, I would calculate average x and y coordinates (that would be the center), and then compute distances between each point and the center. Maximal and minimal distance would be the radii of inner and outer circle. (You could also choose other percentile if you wish).
If that are not circles, but something more complex, you could approximate outer shape as poligon using convex hull, and innner using something like marching squares (Or use marching squares for both). Than you could do point inside poligon test for points you choose.
Upvotes: 1