function arch(a,b,theta1,theta2,r1,r2,ring_color) % Adds an arch with center (a,b), inner radius r1, and outer radius r2 to the current figure. % The arch is the set of all points of the form (a+r*cos(theta),b+r*sin(theta)) where % r1 <= r <= r2 and theta1 <= theta <= theta2, with theta1 and theta2 in radians. % The color of the displayed arch is prescribed by ring_color, a 3-vector encoding the rgb triple. % Build arch in .01 radian increments, being sure to include the endpoint theta = [theta1:.01:theta2 theta2]; n = length(theta); % Counter-clockwise around the outside outx = a + r2*cos(theta); outy = b + r2*sin(theta); % Clockwise around the inside inx = a + r1*cos(theta(n:-1:1)); iny = b + r1*sin(theta(n:-1:1)); % Draw the ring fill([outx inx], [outy iny], ring_color);