|
PatchworkOS
|
Polygon. More...
Functions | |
| void | polygon_rotate (point_t *points, uint64_t pointCount, double angle, point_t center) |
| Rotate a polygon around a center point. | |
| bool | polygon_contains (double px, double py, const point_t *points, uint64_t pointCount) |
| Check if a point is inside a polygon. | |
Polygon.
Check if a point is inside a polygon.
We use doubles for the point coordinates instead of just point_t to allow for sub-pixel points.
| px | The x coordinate of the point. |
| py | The y coordinate of the point. |
| points | The points of the polygon. |
| pointCount | The number of points in the polygon. |
true if the point is inside the polygon, false otherwise. Definition at line 27 of file polygon.c.
References point_t::x, and point_t::y.
Referenced by draw_polygon().
Rotate a polygon around a center point.
| points | The points of the polygon. |
| pointCount | The number of points in the polygon. |
| angle | The angle to rotate by, in radians. |
| center | The center point to rotate around. |
Definition at line 4 of file polygon.c.
References cos(), NULL, round(), sin(), point_t::x, and point_t::y.
Referenced by draw_hand(), and draw_marker().