I want to obtain the distance and angle between two coordinates and the arctan of the difference between these two coordinates
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fernando Alan Gomez
el 30 de Sept. de 2017
Comentada: Walter Roberson
el 30 de Sept. de 2017
function [ vDist, vBearing] = vDistB( A , B )
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
A = [E1,N1];
B = [E2,N2];
vDist = sqrt((E2-E1).^2)+(N2-N1).^2))
vBearing = atan((E2-E1)./(N2-N1))
1 comentario
Walter Roberson
el 30 de Sept. de 2017
We recommend atan2() instead of atan().
Your code uses E1, E2, N1, and N2, without defining them, and for unknown reasons it accepts A and B but ignores their values.
Respuestas (0)
Ver también
Categorías
Más información sobre Elementary Polygons 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!