add length method
This commit is contained in:
parent
a8ce980594
commit
69708dc640
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue