Hello. I’m writing a modeling add-on, and I have the following mathematical problem.
2 edges in the space. Thay are not parallel and not incident. I know the coordinates of their vertices. How can I calculate the extreme vertices of the minimum distance segment between them?
I had started this function:
Comunque il segmento più corto che unisce 2 rette in uno spazio tridimensionale giace sulla retta perpendicolare ad entrambi i segmenti.
Quando due rette sono perpendicolari? Quando il loro prodotto scalare è uguale a zero.
Potrebbe capitare però che questa retta non intersechi mai il tuo segmento (poiché questa è una procedura per le rette, non per i segmenti). In ogni caso dovrebbe bastare prolungare idealmente il segmento, il vertice più vicino all’ipotetico punto di incontro è quello giusto.
In ogni caso internet è pieno di riferimenti a questo genere di problemi, cerca qualcosa su la distanza di 2 rette (quello che tu stai cercando è il segmento che giace sulla distanza delle 2 rette).
Search for perpendicular lines. There are many papers on this on the internet, search for distance between 2 lines, this is defined as the shortest path between the 2 edges