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