How can I rotate a curved rectangle?
이전 댓글 표시
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
rectangle2() from the file exchange can rotate a curved rectangle.
rectangle2([x,y,w,h],'Curvature',[a,b],'Rotation',deg);
Examples:

Antje Nuthmann
2021년 3월 20일
rectangle2 works well, thanks!
답변 (2개)
Friedrich
2013년 4월 10일
0 개 추천
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
Laleh
2013년 4월 10일
Friedrich
2013년 4월 10일
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
2013년 4월 10일
Friedrich
2013년 4월 10일
The rotate function can rotate graphic objects:
But not a rectangle object :(
Laleh
2013년 4월 10일
Friedrich
2013년 4월 11일
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
2013년 4월 10일
편집: Rafal Samborski
2013년 4월 10일
If it's ony about plotting try to call this after your plot function:
alpha = 30; set(gca, 'View', [alpha 90]);
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!