MATLAB: Finding normal vector to a line in 2D

normal linevector

I know the two points in a line. (x1,y1), (x2,y2). how can I find the normal vector to that line?

Best Answer

Find the distance between the two points and then
norm(distance,2)
Most vectors need to have the zero vector as their starting point. Otherwise they have problems obeying all the rules of vector space. the norm(A,2) finds the second norm of a vector starting from zero. Which is basically the length.
to find a normal vector you need to divide the vector by it's second norm.
Related Question