Transformations of a plane
Show older comments
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?
Answers (1)
Bjorn Gustavsson
on 20 Oct 2015
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
Categories
Find more on Get Started with Phased Array System Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!