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?

Réponses (1)

Bjorn Gustavsson
Bjorn Gustavsson le 20 Oct 2015

0 votes

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

Catégories

En savoir plus sur Get Started with Phased Array System Toolbox dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by