40 #ifdef CHECK_MEMORY_LEAKS
42 #endif // CHECK_MEMORY_LEAKS
53 : myP1(p1), myP2(p2) {}
134 std::vector<SUMOReal>
137 std::vector<SUMOReal> ret;
138 for (
size_t i = 0; i < p.size(); i++) {
248 os << line.
myP1 <<
" " << line.
myP2;
SUMOReal length2D() const
SUMOReal atan2PositiveAngle() const
void sub(SUMOReal dx, SUMOReal dy)
Substracts the given position from this one.
SUMOReal atan2DegreeAngle() const
static std::pair< SUMOReal, SUMOReal > getNormal90D_CW(const Position &beg, const Position &end, SUMOReal length, SUMOReal wanted_offset)
const Position & p2() const
void reshiftRotate(SUMOReal xoff, SUMOReal yoff, SUMOReal rot)
static Position intersection_position2D(const Position &p11, const Position &p12, const Position &p21, const Position &p22)
returns the intersection point of the (infinite) lines p11,p12 and p21,p22. If the given lines are pa...
void add(const Position &pos)
Adds the given position to this one.
SUMOReal intersectsAtLength2D(const Line &v)
returns distance between myP1 and intersection or -1 if line segments do not intersect ...
SUMOReal atan2DegreeSlope() const
Position getPositionAtDistance2D(SUMOReal offset) const
void rotateAtP1(SUMOReal rot)
void extrapolateFirstBy(SUMOReal length)
static Position extrapolate_second(const Position &p1, const Position &p2, SUMOReal length)
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
static Position extrapolate_first(const Position &p1, const Position &p2, SUMOReal length)
SUMOReal x() const
Returns the x-position.
Position getPositionAtDistance(SUMOReal offset) const
static SUMOReal nearest_offset_on_line_to_point2D(const Position &l1, const Position &l2, const Position &p, bool perpendicular=true)
static bool intersects(const Position &p11, const Position &p12, const Position &p21, const Position &p22)
return whether given lines intersect
const Position & p1() const
A point in 2D or 3D with translation and scaling methods.
void move2side(SUMOReal amount)
SUMOReal z() const
Returns the z-position.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
SUMOReal atan2Angle() const
bool intersects(const Line &l) const
std::ostream & operator<<(std::ostream &os, const Line &line)
void extrapolateBy(SUMOReal length)
void push_back(const PositionVector &p)
Appends all positions from the given vector.
void extrapolateSecondBy(SUMOReal length)
PositionVector intersectionPoints2D(const Line &line) const
SUMOReal y() const
Returns the y-position.
void sub(SUMOReal x, SUMOReal y)
void extrapolateBy2D(SUMOReal length)
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
std::vector< SUMOReal > intersectsAtLengths2D(const PositionVector &v)
Position intersectsAt(const Line &l) const
void add(SUMOReal x, SUMOReal y)