필터 지우기
필터 지우기

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