### 3 releases

0.3.2 | Apr 8, 2024 |
---|---|

0.3.1 | Apr 6, 2024 |

0.3.0 | Apr 6, 2024 |

#**1014** in Algorithms

**MIT**license

36KB

630 lines

# Distance Difference Triangulation

‖ **Docs.rs** ‖ **Lib.rs** ‖ **Crates.io** ‖

This crate consists of exactly one function:

.`distance_difference_triangulation`

The premise is as follows: You are at some unknown position in 2D space. There
are three beacons. You *do not* know the distances to these three beacons,
otherwise you could just do normal triangulation and be done with it. But you
*do* know the *differences between the distances* to these beacons. You also
know the distances between the beacons themselves. From this information, the
function this crate provides computes your position, relative to the coordinate
system defined by the beacons.

In mathematical terms:

Your *unknown* position is

.`(`x`,`y`)`

The *unknown* distances to the three beacons are

, `d0`

and `d1`

.`d2`

You do know

and `dd01 = d0 - d1`

`dd02 ``=` d0 `-` d2

(and also `dd12 ``=` d1 `-` d2

, but that's redundant).You also know the distances between the beacons

, `d01`

and `d02`

.`d12`

The function of this crate computes for you your position *in* the coordinate
system where beacon 0 is at

and beacon 1 is on the x axis.`(``0``,``0``)`

See also triangulation_from_dist_diff.