Home > Matching_SYM_LSM > src > Functions > Graphics > plot_circle_direction_with_background.m

plot_circle_direction_with_background

PURPOSE ^

% plot circle with direction and with background

SYNOPSIS ^

function plot_circle_direction_with_background(x,y,s,d,f1,f2)

DESCRIPTION ^

% plot circle with direction and with background

 Usage:
   plot_square_with_background(x,y,s,d,f1,f2);

 x,y   position
 s     radius
 d     direction
 f1    width of black background
 f2    width of yellow foreground

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% plot circle with direction and with background
0002 %
0003 % Usage:
0004 %   plot_square_with_background(x,y,s,d,f1,f2);
0005 %
0006 % x,y   position
0007 % s     radius
0008 % d     direction
0009 % f1    width of black background
0010 % f2    width of yellow foreground
0011 
0012 function plot_circle_direction_with_background(x,y,s,d,f1,f2)
0013 
0014 if nargin < 4
0015     f1 = 4;
0016     f2 = 2;
0017 end
0018 % number of points on circle
0019 N=100;
0020 % range of directions
0021 phis=0:2*pi/(N+1):2*pi;
0022 % plot circle
0023 plot([x,x+s*sin(d)],[y,y+s*cos(d)],'-k','Linewidth',f1);
0024 plot([x,x+s*sin(d)],[y,y+s*cos(d)],'-y','Linewidth',f2);
0025 % plot direction
0026 plot(x+s*sin(phis),y+s*cos(phis),'-k','Linewidth',f1);
0027 plot(x+s*sin(phis),y+s*cos(phis),'-y','Linewidth',f2);
0028 return

Generated on Sun 19-Jul-2020 23:00:25 by m2html © 2005