Skip to main content

Easy Least-Squares trilateration using scipy

Project description

easy-trilateration

Trilateration example using least squares method in scipy (Graphing tools included).

Trilateration enables the unknown point to be found. However a since there are a number of samples a non linear least squares method needs to be used to find the solution that has the least error.

It is distinct from triangulation which has a series of angles to an unknown point. Trilateration uses a series of distances to an unkown point.

How to install

pip install easy_trilateration

How to use

Simple Trilateration

from easy_trilateration.model import *  
from easy_trilateration.least_squares import easy_least_squares  
from easy_trilateration.graph import *  
  
if __name__ == '__main__':  
    arr = [Circle(Point(100, 100), 50),  
  Circle(Point(100, 50), 50),  
  Circle(Point(50, 50), 50),  
  Circle(Point(50, 100), 50)]  
    result, meta = easy_least_squares(arr)  
    create_circle(result, target=True)  
    draw(arr)

Location History

arr = Trilateration([Circle(100, 100, 70.5),
                     Circle(100, 50, 50),
                     Circle(50, 50, 0),
                     Circle(50, 100, 50)])

arr2 = Trilateration([Circle(100, 100, 50),
                      Circle(100, 50, 70.5),
                      Circle(50, 50, 50),
                      Circle(50, 100, 0)])

arr3 = Trilateration([Circle(100, 100, 0),
                      Circle(100, 50, 50),
                      Circle(50, 50, 70.5),
                      Circle(50, 100, 50)])

arr4 = Trilateration([Circle(100, 100, 50),
                      Circle(100, 50, 0),
                      Circle(50, 50, 50),
                      Circle(50, 100, 70.5)])

hist: [Trilateration] = [arr, arr2, arr3, arr4, arr]

solve_history(hist)

a = animate(hist)

Method

This code uses the scipy.optimize.least_squares method.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easy_trilateration-0.1.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

easy_trilateration-0.1.4-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file easy_trilateration-0.1.4.tar.gz.

File metadata

  • Download URL: easy_trilateration-0.1.4.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for easy_trilateration-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0e262bdfc37210eb31d1ac19ded08f182774ef3862a329fb08f27a64b991eb33
MD5 bf71776bba3183ec7924bb1abdf5e057
BLAKE2b-256 da82b73e14f1db6996701e642aa35083ba40771ea664e4afbff8eedccdcea2af

See more details on using hashes here.

File details

Details for the file easy_trilateration-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: easy_trilateration-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for easy_trilateration-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0c1d49c8c18fa2a04bf1d71257850f7426a4ccc7f225a6ab1b527482308289a6
MD5 f380c63e989d32bc8cb37e40c966a485
BLAKE2b-256 f3db4b31aa22d79a385dc4a505eb84755700b36efd7271370e544c2790f67a64

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page