34 const double dx =
static_cast<double>( aEnd.
x ) - aStart.
x;
35 const double dy =
static_cast<double>( aEnd.
y ) - aStart.
y;
41 const double mx =
static_cast<double>( aMid.
x ) - aStart.
x;
42 const double my =
static_cast<double>( aMid.
y ) - aStart.
y;
43 const double cross = mx * dy - my * dx;
71 m_midx = (
static_cast<double>( aStart.
x ) + aEnd.
x ) * 0.5;
72 m_midy = (
static_cast<double>( aStart.
y ) + aEnd.
y ) * 0.5;
93 -sin_half *
m_uy - cos_half *
m_ny ) );
104 sin_half *
m_uy - cos_half *
m_ny ) );
111 double base_angle = 2.0 * std::asin( ratio );
114 return 2.0 *
M_PI - base_angle;
EDA_ANGLE GetEndAngle() const
Get the angle from arc center to the end point.
double m_ny
Unit vector perpendicular to chord, toward arc center.
bool Compute(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Compute arc geometry from three points defining the arc.
double m_midy
Chord midpoint coordinates.
double m_uy
Unit vector along chord (from start to end)
VECTOR2D GetCenterPoint() const
Get the arc center point.
double GetArcAngle() const
Get the arc angle (total angle swept by the arc) in radians.
double m_centerOffset
Distance from chord midpoint to arc center along n.
EDA_ANGLE GetStartAngle() const
Get the angle from arc center to the start point.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D