25template <
typename NumericType>
39template <
typename NumericType>
53template <
typename NumericType>
81template <
typename NumericType>
89template <
typename NumericType>
98 double rx = ex * cosR - ey * sinR;
99 double ry = ex * sinR + ey * cosR;
101 if constexpr( std::is_integral_v<NumericType> )
108template <
typename NumericType>
111 const double a = std::max( 1.0,
static_cast<double>(
MajorRadius ) );
112 const double b = std::max( 1.0,
static_cast<double>(
MinorRadius ) );
114 const double dx =
static_cast<double>( aPt.
x ) -
static_cast<double>(
Center.x );
115 const double dy =
static_cast<double>( aPt.
y ) -
static_cast<double>(
Center.y );
117 const double cosRot =
Rotation.Cos();
118 const double sinRot =
Rotation.Sin();
119 const double lx = dx * cosRot + dy * sinRot;
120 const double ly = -dx * sinRot + dy * cosRot;
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Plain ellipse / elliptical-arc data.
VECTOR2< NumericType > GetPointAtAngle(EDA_ANGLE angle) const
Get the point on the ellipse at a given angle.
void Mirror(const VECTOR2< NumericType > &aRef, FLIP_DIRECTION aFlipDirection)
Mirror the ellipse along a horizontal or vertical axis passing through aRef.
EDA_ANGLE GetAngleAtPoint(const VECTOR2< NumericType > &aPt) const
Get the parametric angle of a point on the ellipse.
VECTOR2< NumericType > Center
EDA_ANGLE GetSubtendedAngle() const
Get the subtended angle of the ellipse or elliptical arc at the center.
Define a general 2D-vector/point.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
static constexpr EDA_ANGLE ANGLE_180
@ LEFT_RIGHT
Flip left to right (around the Y axis)
VECTOR2< int32_t > VECTOR2I