Assume four points A = (ax, ay), B = (bx, by), C = (cx, cy), D = (dx, dy), and they form the points of a square in anti-clockwise ordering. We move the points so that A is at (0, 0) by subtracting ax from bx, cx, and dx, and subtracting ay from by, cy, and dy, setting ax = ay = 0.
If the points are exactly the corners of a square in anti-clockwise ordering,...
Basic idea (this answers the question of whether I was contributing something new, which was asked by the bot when I clicked to provide an answer):
a rhombus with equal diagonals is a square.
"simple as possible" includes:
no square roots,
no angle-checking or -chasing,
no complex ...
Approximate fit? How about the exact circle?
First you want to guard against some annoying edge cases:
No two points should be identical. Duplicate points contribute no additional information. Ergo you trio is down to two...
The points should not be on the same straight line. Grab a circle and try and draw a line that intersects the circles three times. ...
You said approximate, not best fit, so a simple approach is likely called for.
I'm going to decompose this into three problems for you:
Find the radius given 3 points
Feed your array of points to the first problem 3 at a time, advancing by 1 each time
Find the statistical average of a multitude of points
Fair warning, I haven't read the Scientific paper ...