Created
January 30, 2013 19:15
-
-
Save kgabis/4675885 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int point2d_nquad_of_rectangled_old(Point2D point, RectangleD rect) { | |
| int i; | |
| for (i = 0; i < 4; i++) { | |
| if (point2d_is_in_rectangled(point, rectangled_nquad(rect, i))) { | |
| return i; | |
| } | |
| } | |
| return -1; | |
| } | |
| GS_INLINE int point2d_nquad_of_rectangled_new(Point2D p, RectangleD r) { //added middle to RectangleD | |
| return ((p.y >= r.middle.y) << 1) | (p.x >= r.middle.x); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment