Vector 2D normals

Started by
1 comment, last by apatriarca 12 years, 8 months ago



Having a 2D Vector (x,y), it has two normals, (-y,x) and (y,-x). If you make a function that returns the normal of a 2d vector, which of both is usually more useful? i mean for return that and not the other.

Advertisement
Generally, it will make no difference as long as you are consistent. The only times I can think in which it would make a difference is for instance computing the edge normals for a polygon; depending on the polygon winding (clockwise or anticlockwise) one normal or the other would point into the polygon or out of the polygon.
As long as you are consistent you should be ok with either conventions. I think it's more common to use (-y,x) since it represents a “positive” rotation of 90° and { (x,y), (-y,x) } is a positively oriented basis (it has the same orientation of the current basis). It also corresponds to the multiplication by the imaginary unit when using complex numbers.

This topic is closed to new replies.

Advertisement