-------------------------------------------------------calc_intersection
| 134 | |
| 135 | //-------------------------------------------------------calc_intersection |
| 136 | AGG_INLINE bool calc_intersection(double ax, double ay, double bx, double by, |
| 137 | double cx, double cy, double dx, double dy, |
| 138 | double* x, double* y) |
| 139 | { |
| 140 | double num = (ay-cy) * (dx-cx) - (ax-cx) * (dy-cy); |
| 141 | double den = (bx-ax) * (dy-cy) - (by-ay) * (dx-cx); |
| 142 | if(fabs(den) < intersection_epsilon) return false; |
| 143 | double r = num / den; |
| 144 | *x = ax + r * (bx-ax); |
| 145 | *y = ay + r * (by-ay); |
| 146 | return true; |
| 147 | } |
| 148 | |
| 149 | //-----------------------------------------------------intersection_exists |
| 150 | AGG_INLINE bool intersection_exists(double x1, double y1, double x2, double y2, |
no outgoing calls
no test coverage detected