How to find the angle?

1 次查看(过去 30 天)
Ali Almakhmari
Ali Almakhmari 2023-5-9
编辑: Matt J 2023-5-9
Hi guys. Lets say I have two points, and I want to find the angle (0 to 360 deg measured counter clockwise) from the x-axis to the line connecting those two points. How can I do that in an efficient way?
Example: Point 1 is [1,2] and Point 2 is [4,11]

采纳的回答

Matt J
Matt J 2023-5-9
编辑:Matt J 2023-5-9
One way:
dPt=normalize(Point2-Point1,'n');
angle=acosd(dPt(1)) %degrees

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by