42 #define M_PI 3.1415926535897932384626433832795
45 #define DEG2RAD(x) static_cast<SUMOReal>((x) * M_PI / 180.)
46 #define RAD2DEG(x) static_cast<SUMOReal>((x) * 180. / M_PI)
91 std::vector<SUMOReal>& into);
115 const Position& p,
bool perpendicular =
true);
static std::pair< SUMOReal, SUMOReal > getNormal90D_CW(const Position &beg, const Position &end, SUMOReal length, SUMOReal wanted_offset)
static SUMOReal Angle2D(SUMOReal x1, SUMOReal y1, SUMOReal x2, SUMOReal y2)
static SUMOReal getCWAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the distance of second angle from first angle clockwise.
static SUMOReal getCCWAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the distance of second angle from first angle counter-clockwise.
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...
static Position interpolate(const Position &p1, const Position &p2, SUMOReal length)
static Position extrapolate_second(const Position &p1, const Position &p2, SUMOReal length)
static Position extrapolate_first(const Position &p1, const Position &p2, SUMOReal length)
static void FindLineCircleIntersections(const Position &c, SUMOReal radius, const Position &p1, const Position &p2, std::vector< SUMOReal > &into)
Returns the positions the given circle is crossed by the given line.
static Position crossPoint(const Boundary &b, const PositionVector &v)
A class that stores a 2D geometrical boundary.
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
Some static methods performing geometrical operations.
A point in 2D or 3D with translation and scaling methods.
static Position transfer_to_side(Position &p, const Position &lineBeg, const Position &lineEnd, SUMOReal amount)
static SUMOReal distancePointLine(const Position &point, const Position &lineStart, const Position &lineEnd)
static SUMOReal closestDistancePointLine2D(const Position &point, const Position &lineStart, const Position &lineEnd, Position &outIntersection)
static SUMOReal getMinAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the minimum distance (clockwise/counter-clockwise) between both angles.
static SUMOReal getMaxAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the maximum distance (clockwise/counter-clockwise) between both angles.
static bool pointOnLine(const Position &p, const Position &from, const Position &to)
Returns whether the given point lies on the given line.
static const SUMOReal INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]