필터 지우기
필터 지우기

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

조회 수: 15 (최근 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