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

Function calc_line_point_distance

renderers/agg/include/agg_math.h:73–85  ·  view source on GitHub ↗

------------------------------------------------calc_line_point_distance

Source from the content-addressed store, hash-verified

71
72 //------------------------------------------------calc_line_point_distance
73 AGG_INLINE double calc_line_point_distance(double x1, double y1,
74 double x2, double y2,
75 double x, double y)
76 {
77 double dx = x2-x1;
78 double dy = y2-y1;
79 double d = sqrt(dx * dx + dy * dy);
80 if(d < vertex_dist_epsilon)
81 {
82 return calc_distance(x1, y1, x, y);
83 }
84 return ((x - x2) * dy - (y - y2) * dx) / d;
85 }
86
87 //-------------------------------------------------------calc_line_point_u
88 AGG_INLINE double calc_segment_point_u(double x1, double y1,

Callers

nothing calls this directly

Calls 1

calc_distanceFunction · 0.85

Tested by

no test coverage detected