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) 71 std::vector<SUMOReal>& into);
82 const Position& p,
bool perpendicular =
true);
static SUMOReal angle2D(const Position &p1, const Position &p2)
Returns the angle between two vectors on a plane The angle is from vector 1 to vector 2...
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 crossPoint(const Boundary &b, const PositionVector &v)
static SUMOReal angleDiff(const SUMOReal angle1, const SUMOReal angle2)
Returns the difference of the second angle to the first angle in radiants.
A class that stores a 2D geometrical boundary.
static SUMOReal legacyDegree(const SUMOReal angle, const bool positive=false)
Some static methods performing geometrical operations.
A point in 2D or 3D with translation and scaling methods.
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 SUMOReal naviDegree(const SUMOReal angle)
static SUMOReal getMinAngleDiff(SUMOReal angle1, SUMOReal angle2)
Returns the minimum distance (clockwise/counter-clockwise) between both angles.
static SUMOReal nearest_offset_on_line_to_point2D(const Position &lineStart, const Position &lineEnd, const Position &p, bool perpendicular=true)
static const SUMOReal INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]