%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DRAW_CIRCLE(POS, RADIUS) Draws a circle in the current figure at position POS with radius RADIUS. See also DRAWELLIPSE, DRAWROBOT3D. Author: Arturo Gil. Universidad Miguel Hernández de Elche. email: arturo.gil@umh.es date: 05/01/2012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0002 % DRAW_CIRCLE(POS, RADIUS) 0003 % Draws a circle in the current figure at position POS with radius 0004 % RADIUS. 0005 % 0006 % See also DRAWELLIPSE, DRAWROBOT3D. 0007 % 0008 % Author: Arturo Gil. Universidad Miguel Hernández de Elche. 0009 % email: arturo.gil@umh.es date: 05/01/2012 0010 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0011 0012 % Copyright (C) 2012, by Arturo Gil Aparicio 0013 % 0014 % This file is part of ARTE (A Robotics Toolbox for Education). 0015 % 0016 % ARTE is free software: you can redistribute it and/or modify 0017 % it under the terms of the GNU Lesser General Public License as published by 0018 % the Free Software Foundation, either version 3 of the License, or 0019 % (at your option) any later version. 0020 % 0021 % ARTE is distributed in the hope that it will be useful, 0022 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0023 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0024 % GNU Lesser General Public License for more details. 0025 % 0026 % You should have received a copy of the GNU Leser General Public License 0027 % along with ARTE. If not, see <http://www.gnu.org/licenses/>. 0028 function draw_circle(pos, radius) 0029 tita = linspace(0, 2*pi,50); 0030 cir = radius*[cos(tita); sin(tita)]; 0031 0032 hp = line(cir(1,:)+pos(1), cir(2,:)+pos(2)); 0033 0034 set(hp, 'LineWidth', 1.5);