Plot graph of points with known inter distances

In summary, the speaker, a biochemist/bioinformatician, needs to plot a graph with clusters for publication. They have already calculated the inter-distances between centroids of the clusters. However, they are unsure of how to calculate the coordinates of each cluster's centroid in a cartesian system. The speaker proposes a solution involving positioning one centroid at the origin and using the law of cosines to determine the correct angles for the other centroids to rotate to their appropriate positions. They also mention the possibility of using spreadsheet formulas to achieve this. The speaker provides a tangible example of their problem, comparing it to positioning furniture in a 2D room based on their known inter-distances. They ask for guidance on how to solve this problem and express
  • #1
noplacebos
3
0
Greetings,

I am a biochemist/bioinformatician. I have a bunch of clusters, of which I have already calculated all their respective (euclidean) inter distances, from centroid to centroid.

I need to plot a graph with these clusters for visual inspection and publication.
My problem is how to calculate the coordinates of each clusters' centroid in a classic cartesian system, in order to properly display a "map" of cluster distances.
Each cluster's centroid should show as a single point on the graph - I will worry about representing each cluster's irregular shape later...


I am sure this is a trivial problem, but didn't have the chance to work with this before. So, by putting the problem down onto paper, I figured that one way to solve this (algorithmically) is by positioning the centroid of one cluster at the origin (0,0) and position all other centroids onto the x axis, each at its respective known distance from the first centroid at (0,0).

Then, all the centroids should make a circular move of angle phi around the origin, in order to adopt the position that satisfies all their known inter-distances.

In the end, we should obtain a cicle with radius equal to the most distant centroid from the one placed at the origin, and all the other centroids scattered within.

It appears to me that a huge set of equations of the form (law of cosines):
a^2 = b^2 + c^2 - 2bc*cosA

would need to be solved, in order to obtain all the correct angles that a specific centroid would need to "rotate" to assume its appropriate position.
In the above formula, "a" is the distance between centroids B and C, while b and c are the distances from the origin for B and C, respectively.

This looks to me like a job that includes some Matrix calculations, but couldn't find exactly what I am looking for, so far.

I would be grateful if you could point me at some direction so to continue my reading with regards to this problem.

Thank you very much in advance

PS. A way to achieve this with the use of some spreadsheet formula (eg excel) is desirable, although I would also like to understand the concept to the solution, in case I had to implement some kind of code.
 
Last edited:
Physics news on Phys.org
  • #2
If I may add a less abstract example, I see the whole problem as having a list of furniture that exist in a 2D room, and I am given all their respective inter distances,

eg I know how far away the couch lies from the armchair, the TV set, the lounge table, etc.,

then how far away the armchair is from the TV set and the lounge table,

and finally the distance between the TV set and the table.

What I need is to draw this room with all furniture correctly positioned (of course we don't care about room dimensions as this is just an example), i.e. their correct relative locations.

Thanks
 

1. What is a plot graph of points with known inter distances?

A plot graph of points with known inter distances is a graphical representation of data points plotted on a coordinate system, where the distance between each point is known. This type of graph is commonly used in scientific research to illustrate relationships between variables or to show the distribution of data.

2. How do you create a plot graph of points with known inter distances?

To create a plot graph of points with known inter distances, you will first need to determine the coordinates of each data point. Then, using a graphing software or by hand, plot each point on a coordinate system according to its coordinates. Finally, connect the points with lines or curves to illustrate the pattern or relationship between them.

3. What is the purpose of using a plot graph of points with known inter distances?

The purpose of using a plot graph of points with known inter distances is to visually represent data in a clear and concise manner. This type of graph allows researchers to easily identify patterns, trends, and relationships between variables, making it a useful tool for data analysis and interpretation.

4. Can a plot graph of points with known inter distances be used for all types of data?

Yes, a plot graph of points with known inter distances can be used for all types of data as long as the data points have known inter distances. This includes numerical data, categorical data, and even spatial data.

5. How can a plot graph of points with known inter distances be interpreted?

To interpret a plot graph of points with known inter distances, you can look at the overall shape of the graph, the direction and slope of the lines connecting the points, and any clusters or outliers present. These visual cues can provide insights into the relationships between variables and the distribution of the data.

Similar threads

Replies
3
Views
1K
  • General Math
Replies
1
Views
965
  • Introductory Physics Homework Help
Replies
2
Views
713
  • Introductory Physics Homework Help
Replies
5
Views
270
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
20
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
121
  • Precalculus Mathematics Homework Help
Replies
20
Views
2K
  • Programming and Computer Science
Replies
1
Views
979
Back
Top