Get all the positions intersecting an angle centered on azimuth and with the given amplitude.
71 double my_semi_amplitude = src_amplitude / 2.0;
73 static const double precision = 0.000000001;
75 double lowest_azimuth = dst_azimuth - dst_amplitude / 2 - my_semi_amplitude + precision;
76 while (lowest_azimuth < 0) lowest_azimuth += 360;
77 lowest_azimuth = fmod(lowest_azimuth, 360);
78 double highest_azimuth = dst_azimuth + dst_amplitude / 2 + my_semi_amplitude - precision;
79 while (highest_azimuth < 0) highest_azimuth += 360;
80 highest_azimuth = fmod(highest_azimuth, 360);
82 std::vector<pair<double, unsigned>> res;
84 if (lowest_azimuth <= highest_azimuth)
86 auto begin =
by_angle.lower_bound(lowest_azimuth);
87 auto end =
by_angle.lower_bound(highest_azimuth);
88 for (
auto i = begin; i != end; ++i)
91 auto begin =
by_angle.upper_bound(lowest_azimuth);
92 auto end =
by_angle.lower_bound(highest_azimuth);
93 for (
auto i = begin; i !=
by_angle.end(); ++i)
95 for (
auto i =
by_angle.begin(); i != end; ++i)
std::map< double, unsigned > by_angle
map azimuth angles to beam indices