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

Function calc_segment_point_sq_distance

renderers/agg/include/agg_math.h:107–122  ·  view source on GitHub ↗

---------------------------------------------calc_line_point_sq_distance

Source from the content-addressed store, hash-verified

105
106 //---------------------------------------------calc_line_point_sq_distance
107 AGG_INLINE double calc_segment_point_sq_distance(double x1, double y1,
108 double x2, double y2,
109 double x, double y,
110 double u)
111 {
112 if(u <= 0)
113 {
114 return calc_sq_distance(x, y, x1, y1);
115 }
116 else
117 if(u >= 1)
118 {
119 return calc_sq_distance(x, y, x2, y2);
120 }
121 return calc_sq_distance(x, y, x1 + u * (x2 - x1), y1 + u * (y2 - y1));
122 }
123
124 //---------------------------------------------calc_line_point_sq_distance
125 AGG_INLINE double calc_segment_point_sq_distance(double x1, double y1,

Callers

nothing calls this directly

Calls 2

calc_sq_distanceFunction · 0.85
calc_segment_point_uFunction · 0.85

Tested by

no test coverage detected