add length method

This commit is contained in:
Jiri Drbalek 2014-08-20 19:19:03 +00:00
parent a8ce980594
commit 69708dc640

View file

@ -22,6 +22,9 @@
#ifndef MAPNIK_PIXEL_POSITION_HPP
#define MAPNIK_PIXEL_POSITION_HPP
// stl
#include <cmath>
namespace mapnik
{
@ -68,6 +71,11 @@ struct pixel_position
{
return pixel_position(x, -y);
}
double length()
{
return std::sqrt(x * x + y * y);
}
};
inline pixel_position operator* (double factor, pixel_position const& pos)