% some functions for plotting points and lines: % plotPoints plots a number of hom. 2D points in the current figure. The % point list is assumed to be 3xN. function plotPoints( pList, color ) hold on % Are the points homogeneous? if (nargin < 2) color = 'r'; end if (size(pList,1) ~= 3) error('Points must be homogeneous!'); end n = size(pList, 2); %move points to z=1-plane: pList(1,:) = pList(1,:) ./ pList(3,:); pList(2,:) = pList(2,:) ./ pList(3,:); pList(3,:) = ones(1,n); for i=1:n s = strcat('P',int2str(i)); %plotPoint(pList(:,i), 'r+', s); tmp = strcat(color, '+'); plot(pList(1,i), pList(2,i), tmp); text(pList(1,i)+5,pList(2,i)-5,s,'Color',color); % offset text 5 pixels to the right and up end