59 VECTOR2I* aIntersectionPoint =
nullptr );
152 bool aMinArcAngle =
true );
166inline double DEG2RAD(
double deg ) {
return deg * M_PI / 180.0; }
167inline double RAD2DEG(
double rad ) {
return rad * 180.0 / M_PI; }
170inline double RAD2DECIDEG(
double rad ) {
return rad * 1800.0 / M_PI; }
182 while( Angle >= 3600 )
198 while( Angle <= -1800 )
201 while( Angle > 1800 )
217 double end = aEndAngle;
219 if( aStartAngle > aEndAngle )
222 return aStartAngle < 360.0 && end > 360.0;
235 double end = aEndAngle;
237 if( aStartAngle > aEndAngle )
240 return aStartAngle < 180.0 && end > 180.0;
const VECTOR2I CalcArcMid(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, bool aMinArcAngle=true)
Return the middle point of an arc, half-way between aStart and aEnd.
VECTOR2I GetRotated(const VECTOR2I &aVector, const EDA_ANGLE &aAngle)
Return a new VECTOR2I that is the result of rotating aVector by aAngle.
bool TestSegmentHit(const VECTOR2I &aRefPoint, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
bool InterceptsPositiveX(double aStartAngle, double aEndAngle)
Test if an arc from aStartAngle to aEndAngle crosses the positive X axis (0 degrees).
void NORMALIZE_ANGLE_POS(T &Angle)
bool InterceptsNegativeX(double aStartAngle, double aEndAngle)
Test if an arc from aStartAngle to aEndAngle crosses the negative X axis (180 degrees).
T NormalizeAnglePos(T Angle)
Normalize angle to be in the 0.0 .
bool SegmentIntersectsSegment(const VECTOR2I &a_p1_l1, const VECTOR2I &a_p2_l1, const VECTOR2I &a_p1_l2, const VECTOR2I &a_p2_l2, VECTOR2I *aIntersectionPoint=nullptr)
Test if two lines intersect.
bool IsPointOnSegment(const VECTOR2I &aSegStart, const VECTOR2I &aSegEnd, const VECTOR2I &aTestPoint)
Test if aTestPoint is on line defined by aSegStart and aSegEnd.
double RAD2DEG(double rad)
double DEG2RAD(double deg)
T NormalizeAngle180(T Angle)
Normalize angle to be in the -180.0 .
const VECTOR2I CalcArcCenter(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Determine the center of an arc or circle given three points on its circumference.
double RAD2DECIDEG(double rad)