I am writing an app for beacon localization and I am looking for a formula which, given beacons of known positions and distance from target, finds the target position.
eg.
given beacon1 located at (x1,y1), distance from target=d1,
beacon2 located at (x2,y2), distance from target=d2....
find target postion
I have searched a question which seems to be useful: Trilateration algorithm for n amount of points
but for the formula in the above website:
fit = NonlinearModelFit[data, Norm[{x, y} - {x0, y0}], {x0, y0}, {x, y}, Weights -> 1/observations^2]
I don't have an idea to implement this in the android app. Also, it said it is using weighted nonlinear least squares fitting. I have searched for it and it is full of matrix and complex steps so I feel lost to implement it.