I have what I’m sure is a very simple problem but I can’t work it out.
I have two 2d vectors that form a line and I am looking to find the normals of this line. example:
vector 1 = ( -10 , 10 ) vector 2 = ( -10, -10 )
How do I calculate the normals for the line defined by these vectors?
It’s hard to tell which “normal” you want.
Do you mean out of the plane that the two vectors lie in? That’s the cross-product of the two. In this case it’s simple: (0, 0, 1) is the normal vector, because both lie in the xy-plane.
Do you mean one of the two normals in the plane for the line that runs from the head of vector 1 to the head of vector 2? All you need to do there is calculate the vector between them, exchange the values of the x- and y-components, and toggle the sign of either component.
In your case,
The normal vector is:
Obviously you should normalize these to be unit vectors.
There are two vectors perpendicular to any line in a plane; they point in opposite directions.