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