lemmingapex / trilateration

Solves a formulation of n-D space trilateration problem using a nonlinear least squares optimizer
MIT License
398 stars 106 forks source link

How to use it in R³ localization? #30

Closed ppooii12009 closed 4 years ago

ppooii12009 commented 4 years ago

I want to do some localizations in real spaces through iBeacon devices, and have successfully imported your dependency. But the sample codes only show how to reach the answer in R² space so how to use it in R³ space ?

kburfi commented 4 years ago

The double[][] positions in the example is n-dimensional. In the second dimension of the array you can give the n-dimensional Positions, e. g. double[][] positions = new double[][] { { 5.0, -6.0, 6.5 }, { 13.0, -15.0, -2.3 }, { 21.0, -3.0, -4.6 }, { 12.4, -21.2, -7,3 } };

ppooii12009 commented 4 years ago

Got it ! I just misunderstood the meaning of array 'positions' Great gratitude !