How to calculate maximum distance between two points (coordinates) on a XY (2D) plane ?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Viraj Sabane
el 30 de Abr. de 2024
Comentada: Viraj Sabane
el 30 de Abr. de 2024
I am plotting two vectors (x and y), i.e. plot x vs. y.
I want to calculate distance between points which are furthest away from each other. I also need their indices to reference a time stamp.
Using pdist2 I get the pink line, but the black line (annotation) seem to be the actual largest distance.
0 comentarios
Respuesta aceptada
Voss
el 30 de Abr. de 2024
"seem to be the largest distance"
Seems to be, but it's not. The x-scale and y-scale are not quite the same. Use
axis equal
to view the plot with a 1:1 aspect ratio. When you do that, I bet you'll see that the greatest distance given by pdist2 is correct.
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!