clear all;
% area
xborder=[0,100];
yborder=[0,100];
line([xborder(1),xborder(2),xborder(2),xborder(1)],[yborder(1),yborder(1),yborder(2),yborder(2)]);
hold on;

% potential field simulation
% initial and goal location of the robot
rinit=[20,70];
rgoal=[60,40];
plot(rinit(1),rinit(2),'rd')
plot(rgoal(1),rgoal(2),'rd')


% obstacle is a cylinder
% center of the cylinder
obstacle_center=[40,60];
radius=10;
xfirst=obstacle_center(1)+radius*cos(0);
yfirst=obstacle_center(2)+radius*sin(0);

for i=0:10:360
    teta=(i*pi)/180;
    xc=obstacle_center(1)+(radius*cos(teta));
    yc=obstacle_center(2)+(radius*sin(teta));
    line([xfirst,xc],[yfirst,yc]);
    xfirst = xc;
    yfirst = yc;
end

