Code covered by the BSD License
 angle2Points(varargin)
ANGLE2POINTS Compute horizontal angle between 2 points
 botloc( prop )
Returns the location of the bot
 detround( bw )
 food_loc( food )
to get the location of the food
 get_are( im )
returns the filtered bw image of the arena
 get_cir( bw )
returns the centroids of the two circles, larger and smaller
 get_ore( bw )
returns the orientation of the bot
 get_prop( are )
returns the property matrix of the arena in terms of area and centroid of
 get_wall(im)
returns the walls present in the arena
 getadmat( are,wall )
getadmat is used to get the adjecency matrix representing the arena
 imt=niblack(im,k,N)
Niblack's method
 lineAngle(varargin)
LINEANGLE Computes angle between two straight lines
 motion( path, dist, o )
gives the motion followed by the bot and the orientation of the bot
 path( adj_mat,bot_loc,foo...UNTITLED Summary of this function goes here
 portout( path, mot, prop,...returns the corrections made by the bot during real time processing
 real4  Copy.mInitialising video preview
 real4 test.minitialization
 real4.minitialization
 testmain2.m

View all files
Automata Engineer 2010 NITK
by
Anurag Ranjan
29 Oct 2010
(Updated
05 Nov 2010)
This code solves the problem statement of Automata Engineer 2010 NITK.

lineAngle(varargin)

function theta = lineAngle(varargin)
%LINEANGLE Computes angle between two straight lines
%
% A = lineAngle(LINE);
% Returns the angle between horizontal, rightaxis and the given line.
% Angle is fiven in radians, between 0 and 2*pi, in counterclockwise
% direction.
%
% A = lineAngle(LINE1, LINE2);
% Returns the directed angle between the two lines. Angle is given in
% radians between 0 and 2*pi, in counterclockwise direction.
%
% See also
% lines2d, angles2d, createLine, formatAngle
%
% 
% author : David Legland
% INRA  TPV URPOI  BIA IMASTE
% created the 31/10/2003.
%
% HISTORY :
% 19/02/2004 : added support for multiple lines.
nargs = length(varargin);
if nargs == 1
% one line
line = varargin{1};
theta = mod(atan2(line(:,4), line(:,3)) + 2*pi, 2*pi);
elseif nargs==2
% two lines
theta1 = lineAngle(varargin{1});
theta2 = lineAngle(varargin{2});
theta = mod(theta2theta1+2*pi, 2*pi);
end


Contact us