59 VECTOR2I* aIntersectionPoint =
nullptr );
126 bool aMinArcAngle =
true );
140inline double DEG2RAD(
double deg ) {
return deg * M_PI / 180.0; }
141inline double RAD2DEG(
double rad ) {
return rad * 180.0 / M_PI; }
144inline double RAD2DECIDEG(
double rad ) {
return rad * 1800.0 / M_PI; }
156 while( Angle >= 3600 )
172 while( Angle <= -1800 )
175 while( Angle > 1800 )
191 double end = aEndAngle;
193 if( aStartAngle > aEndAngle )
196 return aStartAngle < 360.0 && end > 360.0;
209 double end = aEndAngle;
211 if( aStartAngle > aEndAngle )
214 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.
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)