changeset 1604 | bf85a8c213d5 |
parent 1600 | 1a1101c83922 |
child 1616 | 897d26dfba35 |
--- a/src/node/position.cc Wed Jul 18 17:06:36 2007 +0200 +++ b/src/node/position.cc Wed Jul 18 17:07:15 2007 +0200 @@ -1,4 +1,5 @@ #include "position.h" +#include "ns3/rectangle.h" #include <cmath> namespace ns3 { @@ -16,6 +17,14 @@ z (0.0) {} +bool +Position::IsInside (const Rectangle &rectangle) const +{ + return + x <= rectangle.xMax && x >= rectangle.xMin && + y <= rectangle.yMax && y >= rectangle.yMin; +} + double CalculateDistance (const Position &a, const Position &b) {