27 double width,
int accuracy,
35 const double r_o = sqrt(width*width + height*height) / 2.0;
39 else if (accuracy == 0)
42 const double h_half = height / 2.0;
43 const double w_half = width / 2.0;
44 const double r_i = std::min(w_half, h_half);
48 else if (accuracy == 1)
57 const double h_clear = sqrt(d*d - w_half*w_half);
58 h_new = h_half - h_clear;
60 delta_x = h_clear + h_new / 2.0;
65 const double w_clear = sqrt(d*d - h_half*h_half);
67 w_new = w_half - w_clear;
69 delta_y = w_clear + w_new / 2.0;
71 const double theta_cos = cos(theta);
72 const double theta_sin = sin(theta);
73 const double x_shift = theta_cos*delta_x - theta_sin*delta_y;
74 const double y_shift = theta_sin*delta_x + theta_cos*delta_y;
77 accuracy, distance_map) ||
79 accuracy, distance_map));
89 for(
unsigned int i = 0; i < edges.size() - 1; ++i)
91 if ((edges[i].second <= y && edges[i + 1].second > y) ||
92 (edges[i].second > y && edges[i + 1].second <= y))
94 float vt = (float)(y - edges[i].second) /
95 (edges[i + 1].second - edges[i].second);
96 if (x < edges[i].first + vt * (edges[i + 1].first - edges[i].first))
float getResolution() const
float distanceMapAt(double wx, double wy) const