Can you tell me how to take coordinate 1 1, -1 1, -1 -1, 1 -1 and rotate this square clockwise by 45 degrees. How do i input the cos and sin values into matlab?

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2015년 10월 20일

0 개 추천

Well first you'd better put your coordinates in a 2-D array:
r_Corners = [1 1; -1 1; -1 -1; 1 -1]';
Then you'd make yourself a rotation matrix:
mRot = @(phi) [cos(phi) -sin(phi);sin(phi) cos(phi)];
Then it's as simple as:
rTransformed = mRot(pi/43)*rCorners;
HTH

카테고리

도움말 센터File Exchange에서 Get Started with Phased Array System Toolbox에 대해 자세히 알아보기

태그

질문:

2015년 10월 20일

답변:

2015년 10월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by