Finding Shortest distance from a point to a Line,which passes through a midpoint and is oriented at an angle Theta to X-Axis
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Math Enthusiast
le 2 Nov 2018
Modifié(e) : Bruno Luong
le 2 Nov 2018
Hi,
I have a line,which passes through certain point "P" and is oriented at an angle "theta" degrees to X-Axis. Now,I would like to find the shortest distance from a certain point 'Q" to this line.
Thanks in Advance!
0 commentaires
Réponse acceptée
Bruno Luong
le 2 Nov 2018
Assuming your points are (2 x 1) vectors
d = abs(dot(Q-P,[-sin(theta);cos(theta)]))
3 commentaires
madhan ravi
le 2 Nov 2018
Modifié(e) : madhan ravi
le 2 Nov 2018
theta is supposed to be in radians, to apply the above logic right?
Yes
because sin() takes argument as radians and sind() takes degrees as argument.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!