lsofiadb / Trilateration-algorithm

Algorithm to locate a vehicle based on the position of 3 satellites and to decipher an encoded message.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trilateration algorithm πŸ‘©β€πŸ’»

 Objective πŸ”­

Locate the position of a vehicle and identify if it is in danger. πŸ”

Solution πŸ”¬

  • Mathematical trilateration algorithm to locate the position of a vehicle based on the position of 3 satellites.
  • Algorithm that allows deciphering an encoded message sent by a vehicle.

Tools and dependencies used πŸ”¨

Spring Boot, Java 17, OrgJSON, Heroku, Docker, Postman πŸƒ

Operation of the API πŸ›°οΈ

To execute the API, the corresponding HTTP request will be made through Postman, requesting the service at the URL: https://localhost:8081/tracking/, selecting the POST method, as well as the Body and raw options. In this way, a section will be enabled to add the information (in JSON format) of the payload:

  • Distances between each satellite (indicating its name) and the vehicle
  • Encoded message"
{
    "satellites":[
        {
        "name": "Sputnik",
        "distance": 568.3009467828068
        },
        {
        "name": "Explorer",
        "distance": 100.18024812424105
        },
        {
        "name": "Asterix",
        "distance": 476.29383589779377
        }
    ],
        "message": [
            "AGAJGA",
            "AAAADC",
            "AAADAD",
            "ACDADD",
            "CDCDFD",
            "CCCCED"
        ]
}

When it is possible to locate the vehicle and the deciphered message indicates that it is in danger, the request returns the coordinates of its location (which are approximated to a single decimal place in the output), as shown below:

It should be noted that if a high level of precision is desired, it is pertinent to enter data with a greater number of decimals.

The operation of the algorithm can be geometrically visualized, where the three circles intersect at a single point. To learn more about the mathematical development, you can consult the documentation πŸ’‘

About

Algorithm to locate a vehicle based on the position of 3 satellites and to decipher an encoded message.


Languages

Language:Java 98.5%Language:Dockerfile 1.5%