Contents

function LineThroughVector(p,v)

LineThroughVector(Point,Vector)

Plot the line throuh a given point, parallel to a given vector

Plot Basics

	close all
	hold on;
	m = max(v) + 2;
	axis([-m,m,-m,m])

Plot the point x0

	disp('The point x0 is in blue, the origin is a red cross.');
	plot(p(1),p(2),'*b','MarkerSize',10);
	plot(0,0,'r+',0,0,'ro','MarkerSize',20); % Plot the same point in different symbols
	pause;

Plot the vector for which the line will be parallel to

	disp('The vector x which defines the direction is in red.');
	PlotVector(v,'.r');
	pause;

Plot the line in green

	disp('The line through the blue point x0, parallel to the red vector x is in green.');
	for t = -3:.05:3;
		    u = t*v + p ;
			plot(u(1),u(2),'g.','MarkerSize',10)
			drawnow;
			pause(.01);
	end