• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Vector 2D normals

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1Si_con  Members

Posted 24 July 2011 - 01:31 PM

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.

### #2luca-deltodesco  Members

Posted 24 July 2011 - 01:43 PM

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.

### #3apatriarca  Members

Posted 24 July 2011 - 05:27 PM

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.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.