File Exchange

image thumbnail

rotatedObject: Rotate any 2D object by handle, vertex list, or bounding box

version 1.1.0.1 (6.38 KB) by Brett Shoelson
Easily rotate any 2D object: rectangles, ellipses, imrois, xy-coordinates

2 Downloads

Updated 30 Jan 2018

View License

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.

Cite As

Brett Shoelson (2019). 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 .

Comments and Ratings (2)

@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

Updates

1.1.0.1

Providing missing function vertToPos(); necessary for one of the examples. Thanks to Gary for pointing out the omission.

1.1.0.1

Updated license

1.1.0.0

Extends, replaces the original rotatedRectangle file.

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux