Minimize vertices distance between triangles

  • Thread starter Thread starter Spiderman
  • Start date Start date
  • Tags Tags
    Triangles
AI Thread Summary
To minimize the distance between corresponding vertices of two triangles in three dimensions, the discussion focuses on the need for a fast method to overlay the triangles through rotation and translation. The user seeks an exact solution that is faster than current methods, which involve either slow exact calculations or quicker approximate techniques. Suggestions include aligning centroids and optimizing through rotation and reflection, but these methods are still deemed too slow for the user's needs. The user ultimately shares a new approach involving calculating vertex differences and adjusting points based on these calculations. This method aims to achieve the desired overlay efficiently, addressing the user's requirement for speed in processing numerous triangle overlays.
Spiderman
Messages
7
Reaction score
0
If I have two triangles in three dimensions with vertices a1,b1,c1 and a2,b2,c2, and want to overlay them such that the distance between corresponding verticies is minimized, i.e. such that the total distance between the sum of the distances between the vertices a1-a2, b1-b2 and c1-c2 are minimized, is there a way to do this other than least-squares? I need a fast method as I'm going to be doing this thousands of times in a program but I can't think of a solution that works.
 
Mathematics news on Phys.org
Are you allowed to rotate the triangles?
 
Oh yes. I want to rotate and translate one triangle so that it fits as best as possible over the other. I know ways of doing this, but they all involve too much in the way of computation. I'm sure there is a quick way but my brain won't come up with it.
 
Well, if you're only doing it a few thousand times then speed should be a minor concern. I don't know what methods you have in mind but if you've figured out how to use least squares on this then that should be plenty fast. Do you need an exact solution or just an approximate one, something that "looks like" an okay fit? One thing is that if you can rotate the triangles, you can put them in the same plane and then use translation/rotation/reflection within the plane. If you only need an approximate solution you could make the centroids match up and then optimize by rotation/reflection about the centroid.
 
Thanks for the suggestions. I've used those techniques and they are too slow. I say a few thousand, but I suppose in actuality I mean something on the order or billions or more. Each instance of the program will currently take about 5 seconds, with maybe 10,000 triangles overlays amongst other things. If I was only running the program once, this would be sufficient, but I'm going to need to run it thousands of times. So every second I can save on a single instance would be very useful.

Currently I can use an exact method, which is slow, and an approximate method, which is pretty fast. I would like an exact method that is as fast or faster than what I have.
 
Alright. I figured it out.

for new point a_1^n

1. calculate the difference between vertices

d_1=|a_1b_1|-|a_2b_2|
d_2=|a_1c_1|-|a_2c_2|

2. a_1^n=a_2+(d_1/2*\vec{u_1})+(d_2/2*\vec{u_2})

where \vec{u_1}=a2-b2 and \vec{u_2}=a2-c2

3. repeat for other two points of triangle.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Thread 'Imaginary Pythagoras'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...

Similar threads

Replies
1
Views
4K
Replies
14
Views
3K
Replies
8
Views
3K
Replies
4
Views
2K
Replies
6
Views
4K
Replies
1
Views
2K
Replies
6
Views
2K
Back
Top