Posted By

jatkins on 05/03/13


Tagged

angle cartesian angles quadrant quadrants


Versions (?)

Find which quadrant an angle is in


 / Published in: JavaScript
 

Released into the public domain.

  1. function findWhichQuadrant(angle) {
  2. if(angle >= 0 && angle < 90)
  3. return 'TR';
  4. else if(angle >= 90 && angle < 180)
  5. return 'TL';
  6. else if(angle >= 180 && angle < 270)
  7. return 'BL';
  8. else if(angle >= 270 && angle < 360)
  9. return 'BR';
  10. }

Report this snippet  

You need to login to post a comment.