• Stars
    star
    398
  • Rank 108,325 (Top 3 %)
  • Language
    Java
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Solves a formulation of n-D space trilateration problem using a nonlinear least squares optimizer

Trilateration

Build Status License

alt text

Solves a formulation of n-D space trilateration problem using a nonlinear least squares optimizer.

Input: positions, distances
Output: centroid with geometry and error

Uses Levenberg-Marquardt algorithm from Apache Commons Math.

double[][] positions = new double[][] { { 5.0, -6.0 }, { 13.0, -15.0 }, { 21.0, -3.0 }, { 12.4, -21.2 } };
double[] distances = new double[] { 8.06, 13.97, 23.32, 15.31 };

NonLinearLeastSquaresSolver solver = new NonLinearLeastSquaresSolver(new TrilaterationFunction(positions, distances), new LevenbergMarquardtOptimizer());
Optimum optimum = solver.solve();

// the answer
double[] centroid = optimum.getPoint().toArray();

// error and geometry information; may throw SingularMatrixException depending the threshold argument provided
RealVector standardDeviation = optimum.getSigma(0);
RealMatrix covarianceMatrix = optimum.getCovariances(0);

The multilateration problem can be formulated as an optimization problem and solved using Non-linear least squares methods. A well-formed solution will be an ellipse in R2, or an ellipsoid in R3. If you are only interested in a maximum likelihood point estimate, the centroid is also provided. R2 space requires at least 3 non-degenerate points and distances to obtain a unique region; and similarly R3 space requires at least 4 non-degenerate points and distances to obtain a unique region.

Getting Trilateration

To add a dependency on Trilateration using Maven, use the following:

<dependency>
    <groupId>com.lemmingapex.trilateration</groupId>
    <artifactId>trilateration</artifactId>
    <version>1.0.2</version>
</dependency>

To add a dependency using Gradle:

dependencies {
  implementation 'com.lemmingapex.trilateration:trilateration:1.0.2'
}

Run the tests

*nix

./gradlew clean
./gradlew test -i

Windows

./gradlew.bat clean
./gradlew.bat test -i

More Repositories

1

N-bodyGravitySimulation

N-body Gravity Simulation
JavaScript
40
star
2

ElementsOfComputingSystems

My Work from The Elements of Computing Systems: Building a Modern Computer from First Principles
HTML
17
star
3

line-integral-convolution

Line Integral Convolution using openGL shaders in GLSL
C++
11
star
4

wifi-probe-request-detector

Detects wifi probe requests
Perl
4
star
5

N-Queens

http://en.wikipedia.org/wiki/Eight_queens_puzzle
C++
4
star
6

DataMining

Projects from my Data Mining class
Processing
4
star
7

LEGOSegway

Balance a Lego Robot
3
star
8

generate-icon-scripts

two shell scripts to generate icns (macOS) and ico (windows) files from icon_1024x1024.png
Shell
3
star
9

ProjectEuler

Project Euler problems
Java
3
star
10

Programming-Challenges-Skiena-Revilla

Solutions for "Programming Challenges (Skiena & Revilla)" submitted to http://uva.onlinejudge.org/
C++
2
star
11

git-repo-transfer

Some one-liners to help clean up your git repo
1
star
12

TreeCSP

Tree puzzle from The World Puzzle Championship, modeled as Integer Linear Programming Constraint Satisfaction Problem
1
star
13

mapbox-gl-nominatim-geocoder

Geocoder control for mapbox-gl-js using the Nominatim Geocoding API
JavaScript
1
star
14

HungarianAlgorithm

A Combinatorial Optimization Algorithm that Solves the Assignment Problem
Java
1
star
15

FabricSimulator

Simulates cloth using the physics of springs
C++
1
star
16

voronoi-diagram-mosaics

Create mosaics using voronoi diagrams
C++
1
star
17

hough-transform

Hough transform for lines in python
Python
1
star
18

double-pendulum

Simulation of a double pendulum written in ECMA script.
JavaScript
1
star
19

FeedforwardNeuralNetwork

Models a feedforward artificial neural network
Java
1
star
20

reaction-diffusion

Models a simple reaction diffusion system
JavaScript
1
star