Rotate any 2D object (specified by its vertices or by handle(s) to an imroi object) by angle theta (in degrees), about any center of rotation.
Create rotated rectangle or ellipse specified by its (unrotated) bounding box.
Specify center of rotation by point, or by corner or centroid of bounding box.
Includes shortcut functions rotateRectangle and rotateEllipse for convenience.
Brett Shoelson (2021). rotatedObject: Rotate any 2D object by handle, vertex list, or bounding box (https://www.mathworks.com/matlabcentral/fileexchange/49529-rotatedobject-rotate-any-2d-object-by-handle-vertex-list-or-bounding-box), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
@Ahmed: xnew and ynew are outputs of the rotatedObject function. width and height should remain unchanged. Unless I am misunderstanding your question...
Brett
thanks very much for your code, i am asking for if after orientation i would like to get a new rectangular points [xnew,ynew, width , height],
@ramesh: if you've found a bug in my code, I need more to go on than that to have any hope of fixing it. Can you show me how you're calling it, and what is going wrong?
Brett
your code is not working can you please update it ..it will be great help
thank you