Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


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.

  • You cannot reply to this topic
2 replies to this topic

#1 Si_con   Members   -  Reputation: 100

Like
0Likes
Like

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.



Sponsor:

#2 luca-deltodesco   Members   -  Reputation: 637

Like
1Likes
Like

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.

#3 apatriarca   Crossbones+   -  Reputation: 1776

Like
1Likes
Like

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.



PARTNERS