Function to draw a tilted rectangle

Version 1.0.0.0 (1.55 KB) by Sudarshan
Specify width, height and angle of orientation of the rectangle, that is drawn on an image
862 Downloads
Updated 14 May 2012

View License

% To draw a rectangle at a given pixel location (center) with any width and
% height rotated at an angle
% Input:
% img - image (gray scale or color)
% center - the pixel location of the center of rectangle 2x1 vector
% width - width of rectangle in pixels
% height - height of rectangle in pixels
% angle - rotation angle of rectangle in degrees
% output:
% hdl = handle to figure

Cite As

Sudarshan (2024). Function to draw a tilted rectangle (https://www.mathworks.com/matlabcentral/fileexchange/36664-function-to-draw-a-tilted-rectangle), MATLAB Central File Exchange. Retrieved .

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

Inspired: Extract Rotated Patch from Image

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0