MCPcopy Create free account
hub / github.com/MapServer/MapServer / calc_intersection

Function calc_intersection

renderers/agg/include/agg_math.h:136–147  ·  view source on GitHub ↗

-------------------------------------------------------calc_intersection

Source from the content-addressed store, hash-verified

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,

Callers 3

triangleMethod · 0.85
calc_miterMethod · 0.85
calc_joinMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected