Transformations of a plane
이전 댓글 표시
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
2015년 10월 20일
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에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!