166 os << p.
x() <<
"," << p.
y();
192 const SUMOReal scalar = (length + offset) / length;
208 }
else if (
myY < p2.
myY) {
Position operator+(const Position &p2) const
void sub(SUMOReal dx, SUMOReal dy)
Substracts the given position from this one.
void add(SUMOReal dx, SUMOReal dy)
Adds the given position to this one.
Position(SUMOReal x, SUMOReal y, SUMOReal z)
parametrised constructor
void add(SUMOReal dx, SUMOReal dy, SUMOReal dz)
Adds the given position to this one.
SUMOReal myZ
The z-position.
SUMOReal angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position ...
void add(const Position &pos)
Adds the given position to this one.
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
void mul(SUMOReal mx, SUMOReal my, SUMOReal mz)
Multiplies position with the given values.
void sub(SUMOReal dx, SUMOReal dy, SUMOReal dz)
Substracts the given position from this one.
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Position crossProduct(const Position &pos)
returns the cross product between this point and the second one
void sub(const Position &pos)
Substracts the given position from this one.
SUMOReal z() const
Returns the z-position.
void mul(SUMOReal mx, SUMOReal my)
Multiplies position with the given values.
A point in 2D or 3D with translation and scaling methods.
bool operator==(const Position &p2) const
SUMOReal myX
The x-position.
bool operator!=(const Position &p2) const
SUMOReal x() const
Returns the x-position.
SUMOReal distanceSquaredTo(const Position &p2) const
friend std::ostream & operator<<(std::ostream &os, const Position &p)
Prints to the output.
SUMOReal dotProduct(const Position &pos)
returns the dot product (scalar product) between this point and the second one
bool almostSame(const Position &p2, SUMOReal maxDiv=POSITION_EPS) const
Position operator*(SUMOReal scalar) const
keep the direction but modify the length of the (location) vector to length * scalar ...
void mul(SUMOReal val)
Multiplies both positions with the given value.
Position operator+(SUMOReal offset) const
keep the direction but modify the length of the (location) vector to length + scalar ...
SUMOReal myY
The y-position.
SUMOReal distanceSquaredTo2D(const Position &p2) const
Position(SUMOReal x, SUMOReal y)
parametrised constructor
SUMOReal y() const
Returns the y-position.
Position()
default constructor
Position operator-(const Position &p2) const
static const Position INVALID
bool operator<(const Position &p2) const
lexicographical sorting for use in maps and sets