Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
how to find mininum distance between two points in a linear triangular element (3 nodes)?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Dear All,
may I ask, how can we determine the minimum distance between two points in each triangular element (3 nodes) in a very efficient way in Matlab?
P.S. Input file includes a lot of triangular elements...
Best regards,
Jacob
5 comentarios
Image Analyst
el 29 de Dic. de 2019
You asked
how to find mininum distance between two points in a linear triangular element (3 nodes)?
may I ask, how can we determine the minimum distance between two points in each triangular element (3 nodes) in a very efficient way in Matlab?
P.S. Input file includes a lot of triangular elements...
Best regards,
Jacob
=====================================================
So, how long is too long? I just did 100,000 iterations and it took 61 milliseconds:
tic
numPoints = 100000;
r1 = rand(numPoints, 2);
r2 = rand(numPoints, 2);
for k = 1 : numPoints
d(k) = sqrt((r1(k, 1) - r2(k, 1))^2 + (r1(k, 2) - r2(k, 2))^2);
end
toc
Elapsed time is 0.061533 seconds.
What form are your points in? Double arrays of 100000-by-2?
Respuestas (0)
La pregunta está cerrada.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!