lemmingapex / trilateration

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Input as cartesians?

JulianSchuette opened this issue · comments

Hi,

just to make sure, I assume TrilaterationFunction expects the position argument to be in cartesian coordinates, not in lat/lon or anything else?

Cheers,
Julian

Julian,

Yes, you are correct. Positions should be valid cartesian coordinates. In full: Inputs identified as tuples (lists) of n real numbers should exist in a euclidean space of dimension n.

If you are using lat/lon, you will need to convert to a cartesian coordinate system. Depending on the range of latitudes and longitudes inputs, and the desired accuracy, you will want to be cognisant of this conversion.

If accuracy is not a concern, you can model the earth as a sphere:
http://stackoverflow.com/questions/1185408/converting-from-longitude-latitude-to-cartesian-coordinates/1185413#1185413

If you have large lat/lon ranges or you are using an ellipsoid model of the earth (like WGS-84), you will want to look into solutions that account for this.

Does this answer your question?

  • Scott

Perfect, Scott. Thanks a lot.
I am using pretty small lat/lon scales (<100m) and can accept minor conversion errors, so I will go the simple route first.

Cheers.

Using the linked SO equations, the input positions would be composed of x and y (throwing away z)?

Why would you throw away z?

The positions are arrays of two doubles but there are three axes in the SO answer. I don't understand how to coerce the SO answer into the required input positions.

Thanks! Much appreciated