diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index d6b202ea0..41dc5f3b2 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -292,7 +292,7 @@ namespace mapnik { cont_.get_vertex(pos,&x1,&y1); double dx = x1 - x0; double dy = y1 - y0; - len += sqrt(dx * dx + dy * dy); + len += std::sqrt(dx * dx + dy * dy); } double midlen = 0.5 * len; double dist = 0.0; @@ -302,7 +302,7 @@ namespace mapnik { cont_.get_vertex(pos,&x1,&y1); double dx = x1 - x0; double dy = y1 - y0; - double seg_len = sqrt(dx * dx + dy * dy); + double seg_len = std::sqrt(dx * dx + dy * dy); if (( dist + seg_len) >= midlen) { double r = (midlen - dist)/seg_len; diff --git a/include/mapnik/image_util.hpp b/include/mapnik/image_util.hpp index 9125a1f97..202eb3ce6 100644 --- a/include/mapnik/image_util.hpp +++ b/include/mapnik/image_util.hpp @@ -114,7 +114,7 @@ namespace mapnik { { double dx = x1-x0; double dy = y1-y0; - return sqrt(dx * dx + dy * dy); + return std::sqrt(dx * dx + dy * dy); } template diff --git a/include/mapnik/markers_converter.hpp b/include/mapnik/markers_converter.hpp index 8587f4390..6dbc2711c 100644 --- a/include/mapnik/markers_converter.hpp +++ b/include/mapnik/markers_converter.hpp @@ -114,7 +114,7 @@ namespace mapnik { ++num_markers_; double dx = x2 - x1; double dy = y2 - y1; - double d = ::sqrt(dx * dx + dy * dy); + double d = std::sqrt(dx * dx + dy * dy); Envelope ext = shape_.extent(); if (d > ext.width()) { diff --git a/src/placement_finder.cpp b/src/placement_finder.cpp index 9706c7f42..8193e173e 100644 --- a/src/placement_finder.cpp +++ b/src/placement_finder.cpp @@ -115,7 +115,7 @@ namespace mapnik double dx = x2-x1; double dy = y2-y1; - double segment_length = ::sqrt(dx*dx + dy*dy); + double segment_length = std::sqrt(dx*dx + dy*dy); distance +=segment_length; if (distance > target_distance) @@ -189,7 +189,7 @@ namespace mapnik else { //Add the length of this segment to the total we have saved up - double segment_length = sqrt(pow(old_x-new_x,2) + pow(old_y-new_y,2)); //Pythagoras + double segment_length = std::sqrt(std::pow(old_x-new_x,2) + std::pow(old_y-new_y,2)); //Pythagoras distance += segment_length; //While we have enough distance to place text in @@ -400,7 +400,7 @@ p.minimum_distance))) { double dx = old_x - new_x; double dy = old_y - new_y; - double distance = sqrt(dx*dx + dy*dy); + double distance = std::sqrt(dx*dx + dy*dy); total_distance += distance; path_distances.push_back(distance); } @@ -646,7 +646,7 @@ p.minimum_distance))) segment_length = path_distances[index]; } - while (sqrt(pow(start_x - new_x, 2) + pow(start_y - new_y, 2)) < ci.width); //Distance from start_ to new_ + while (std::sqrt(std::pow(start_x - new_x, 2) + std::pow(start_y - new_y, 2)) < ci.width); //Distance from start_ to new_ //Calculate the position to place the end of the character on find_line_circle_intersection( @@ -655,7 +655,7 @@ p.minimum_distance))) end_x, end_y); //results are stored in end_x, end_y //Need to calculate distance on the new segment - distance = sqrt(pow(old_x - end_x, 2) + pow(old_y - end_y, 2)); + distance = std::sqrt(std::pow(old_x - end_x, 2) + std::pow(old_y - end_y, 2)); } //Calculate angle from the start of the character to the end based on start_/end_ position @@ -829,11 +829,11 @@ p.minimum_distance))) //Always use the 1st one //We only really have one solution here, as we know the line segment will start in the circle and end outside - double t = (-B + sqrt(det)) / (2 * A); + double t = (-B + std::sqrt(det)) / (2 * A); ix = x1 + t * dx; iy = y1 + t * dy; - //t = (-B - sqrt(det)) / (2 * A); + //t = (-B - std::sqrt(det)) / (2 * A); //ix = x1 + t * dx; //iy = y1 + t * dy;