Is there anyway to calculate the position in coordinates of points using a n*n distance matrix?

10 次查看(过去 30 天)
if there are n points in a 2-D coordinate, it is relatively easy to calculate the distance matrix using their positions. However, can we calculate the position of n points using a n*n distance matrix? And, will there be more than one solution? Results with the same "shape" should be viewed as one solution.
Say, if there are only 3 points and a 3*3 distance matrix, it is very easy to obtain a triangle with only one possible shape. But if n > 3, will it also stand?

采纳的回答

Meme Young
Meme Young 2021-3-27
I have found a mwthod mdscale() to do such things. But first, you have to know what is the dimension of the coordinates.

更多回答(1 个)

David Goodmanson
David Goodmanson 2021-1-21
Hi Meme,
first of all, if all you have are the distances between points, you can translate the all the points together in the 2d plane (two degrees of freedom), and you can rotate all of them together as well (one degree of freedom) without changing any distances. So there are three point coordinates that have to be defined from the start. Let's say that point 1 is taken to be at the origin by translation, and point 2 is taken to be somewhere to the right of point 1, on the x axis, by rotation. After that, you need to define 2*n-3 remaining point coordinates by using the distance matrix.
An nxn distance matrix is symmetric with zeros on the diagonal, so it has n(n-1)/2 independent elements. When n=3, there are 3 matrix elements to define 3 remaining point coordinates, so it works out exactly, as you have noted. But for n>=4. you have more distance conditions (6 for n=4) than coordinates, (5 for n=4) and the problem is overspecified. The distance matrix isn't arbitrary. It has to meet some conditions. The larger n is, the more overspecificaton there is. And the shape is uniquely defined.
Except that, if you flip the entire thing over, 180 degrees about the x axis, no initial point coordinates or distances change. That would, for example, turn an R shape into a backwards R shape, so you need to decide if that counts as different or not.
  1 个评论
Meme Young
Meme Young 2021-1-21
Hi David,
You have proposed something very valuable. Is there any example code showing what you have said? It is a bit abstract and I cannot picture it in my head

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by