how to automatically find the angle from 2 points ?
120 次查看(过去 30 天)
显示 更早的评论
I try to find the angle between 2 points that I manual put it in the image but I want to find the angle between this 2 points with automatically methods.
How to do ? Thank you.
5 个评论
Adam Danz
2020-1-26
If point1 and point2 are defined by (x1,y1), (x2,y2), you can get the angle by
atan(abs(y2-y1)/abs(x2-x1)) % radians
% or
atand(abs(y2-y1)/abs(x2-x1)) % degrees
If you want to programmatically define the two points as well you'll have quite a bit more work to do starting with a solid definition of how they are located.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!