Generate eight distinct shapes from a set of specified variables
3 views (last 30 days)
Show older comments
Yashlin Naidoo
on 28 Apr 2015
Edited: per isakson
on 29 Apr 2015
To be able to generate eight distinct shapes from a set of specified variables using MATLAB image processing. Your shape generator algorithm should be able to generate the following shapes:
-  Circle(Input radius in pixels)
-  Square(Input length of 1 side in pixels. Adjacent sides must be parallel to both borders of the image respectively)
-  Triangle(Input length of base in pixels and both base angles in degrees. The base is associated with column span, which is parallel to the top border, and the apex of triangle must be located at a point above the base line)
-  Rectangle(Input length of 2 adjacent sides in pixels. For display purposes the smaller value is associated with the row span and the larger values is associated with the column span. Adjacent sides must be parallel to both borders of the image respectively)
-  Pentagon(Input length of 1 side in pixels. The base is associated with column span, which is parallel to the top border, and the apex of pentagon must be located at a point above the base line)
-  Hexagon(Input length of 1 side in pixels. At least 2 sides must be parallel to the top and bottom borders of the image)
-  Ellipse(Input length of semi-minor (rows) and semi-major (columns) axes in pixels. For display purposes the semi-minor axis is associated with the row span, and must be parallel to the left and right borders of the image, and the semi-major axis is associated with column span, and must be parallel to the top and bottom borders of the image)
-  Octagon(Input length of 1 side in pixels. At least two sides must be parallel to the top and bottom borders of the image)
1 Comment
Joseph Cheng
on 28 Apr 2015
Edited: per isakson
on 29 Apr 2015
Is there a question here? if not please read http://www.mathworks.com/matlabcentral/answers/8626-how-do-i-get-help-on-homework-questions-on-matlab-answers and http://www.mathworks.com/matlabcentral/answers/214028-how-do-i-generate-eight-distinct-shapes-from-a-set-of-specified-variables-using-matlab-image-process#answer_177030
Accepted Answer
Image Analyst
on 28 Apr 2015
You can do all of those by varying the number of elements in theta in the 4th example in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F
0 Comments
More Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!