What is the angle of vector conecting two points?

조회 수: 1 (최근 30일)
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2016년 5월 19일
댓글: K M Ibrahim Khalilullah 2016년 5월 19일
Suppose I have two points P1(x1,y1) and P2(x2,y2). How can I calculate angle of vector connecting the two points?
  댓글 수: 2
TastyPastry
TastyPastry 2016년 5월 19일
The angle of the vector and what? The x or y axis?
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2016년 5월 19일
no, for pixels of an image. It is related to the direction...

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2016년 5월 19일
Angle means, it shall be anti-clockwise with respect to x -axis... use: theta = atan((y2-y1)/(x2-x1))
  댓글 수: 1
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2016년 5월 19일
thanks for reply>>Actually I need directional vector of the line connecting two point.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by