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)
83 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 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 the line segments defined by Line p11,p12 and Line p21,p22 intersect ...
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 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 SUMOReal closestDistancePointLine(const Position &point, const Position &lineStart, const Position &lineEnd, Position &outIntersection)