Bob Alvarez


« Earlier1 items total Later »

Draw a circle

The code contains two features. One is the use of the 'rectangle' function to draw a circle The other is the use of complex variables to represent coordinates in a 2D space like an image, which I have found quite useful.

zcenter = complex(256,139); % x + iy

radius = 20;

zc = zcenter - complex(radius,radius) % corner position

rh = rectangle('Position', [real(zc) imag(zc) 2*radius 2*radius],'Curvature', [1 1], ...
               'linewidth',1.5,'edgecolor','g');

« Earlier1 items total Later »




Sponsored by

Sole Central

Your one stop shop for Birkenstock and Crocs shoes and sandles.