2d Coordinate rotation in clockwise direction

조회 수: 8 (최근 30일)
Reuben Addison
Reuben Addison 2019년 1월 18일
댓글: Reuben Addison 2019년 1월 18일
How do I rotate a 2d coordinate about the origin in a clockwise direction, I have data points for the origin as [start_x = 24.000;
,start_y = 16.000] and target lorcation [target_x = 27.000,target_y = 16.000], but I want to rotate my target at an angle of 45 degrees clockwise about the origin and I am wondering if there is a way to get a function for the new target coodinates.

채택된 답변

KSSV
KSSV 2019년 1월 18일
th = pi/4 ;
R = [cos(th) -sin(th) ;sin(th) cos(th)] ;
Multiply your points with the above R. Read about rotation matrix: https://en.wikipedia.org/wiki/Rotation_matrix

추가 답변 (1개)

Reuben Addison
Reuben Addison 2019년 1월 18일
I think this function rotates counter clockwise , any idea how I could make it clockwise

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by