How can I rotate a curved rectangle?
Mostra commenti meno recenti
I have created a curved rectangle and now I want to rotate it. I know I can not rotate using rectangle commande. I also tried to plot the rotated rectangle using "fill" but then I can not add curvature.
So, the question is, How can I plot a rotated curved rectangle?
2 Commenti
rectangle2() from the file exchange can rotate a curved rectangle.
rectangle2([x,y,w,h],'Curvature',[a,b],'Rotation',deg);
Examples:

Antje Nuthmann
il 20 Mar 2021
rectangle2 works well, thanks!
Risposte (2)
Friedrich
il 10 Apr 2013
0 voti
HI,
so you have a set of points (x,y) describing a curved rectangle. I guess the keyword here is rotation matrix:
Create the Matrix accoringly and multiple it with your (x,y) values to get the rotated rectangle.
6 Commenti
Laleh
il 10 Apr 2013
Friedrich
il 10 Apr 2013
Yes in that case no chance. You would need do draw that rectangle by yourself to get x,y points and then rotate it by your own or using the rotate function.
Laleh
il 10 Apr 2013
Friedrich
il 10 Apr 2013
The rotate function can rotate graphic objects:
But not a rectangle object :(
Laleh
il 10 Apr 2013
Friedrich
il 11 Apr 2013
You need to create your own version of the rectangle function which calculates the curved rectangle from scratch. Afterwards you can plot it an rotate it.
Rafal Samborski
il 10 Apr 2013
Modificato: Rafal Samborski
il 10 Apr 2013
If it's ony about plotting try to call this after your plot function:
alpha = 30; set(gca, 'View', [alpha 90]);
1 Commento
Laleh
il 10 Apr 2013
Categorie
Scopri di più su Surface and Mesh Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!