finding normal vector to a line in 2D

조회 수: 37 (최근 30일)
bes
bes 2011년 10월 11일
I know the two points in a line. (x1,y1), (x2,y2). how can I find the normal vector to that line?

채택된 답변

William
William 2011년 10월 11일
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.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2011년 10월 11일
The normal vector will be one with a slope of -1 divided by the slope of the line segment.

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by