9 :
Base(), _center(center), _radius(radius), _startAngle(
Math::correctAngle(startAngle)), _endAngle(
Math::correctAngle(endAngle)), _CCW(true) {
23 Arc::Arc(
const Coordinate ¢er,
double radius,
double startAngle,
double endAngle,
bool isCCW)
24 :
Base(), _center(center), _radius(radius), _startAngle(
Math::correctAngle(startAngle)), _endAngle(
Math::correctAngle(endAngle)), _CCW(isCCW) {
31 double ra2 = vra.
squared() * 0.5;
32 double rb2 = vrb.
squared() * 0.5;
33 double crossp = vra.
x() * vrb.
y() - vra.
y() * vrb.
x();
34 if (std::abs(crossp) <= 0.0) {
52 auto isCCW = bulge>0.;
53 auto delta = atan(bulge) * 4.0;
55 auto middle = p1.
mid(p2);
58 auto radius = std::abs(dist / std::sin(delta/2.0));
60 auto wu = std::abs(std::pow(
radius, 2.0) - std::pow(dist, 2.0));
61 auto h = std::sqrt(wu);
70 if (std::abs(delta)<
M_PI) {
143 const double p0 = 0.0 *
M_PI;
144 const double p1 = 0.5 *
M_PI;
145 const double p2 = 1.0 *
M_PI;
146 const double p3 = 1.5 *
M_PI;
double _startAngle
Double startAngle of Arc.
Coordinate nearestPointOnEntity(const Coordinate &coord) const
Coordinate startP() const
Coordinate mid(const Coordinate &other) const
double x() const
Returns x of Coordinate.
static Arc createArc3P(const Coordinate &p1, const Coordinate &p2, const Coordinate &p3)
double angleTo(const Coordinate &v) const
Returns angle To the coordinate.
double _endAngle
Double endAngle of Arc.
double y() const
Returns y of Coordinate.
Area merge(const Area &other) const
merge two area's and expand if required to largest containing area
static Arc createArcBulge(const Coordinate &p1, const Coordinate &p2, const double bulge)
bool CCW() const
Returns of the arc is in reversed direction.
double endAngle() const
Returns the EndAngle.
Coordinate _center
Coordinate center of Arc.
Coordinate nearestPointOnPath(const Coordinate &coord) const
Arc(const Coordinate ¢er, double radius, double startAngle, double endAngle)
static double correctAngle(double a)
correctAngle, Corrects angle to be in -PI to PI
static bool isAngleBetween(double a, double start, double end, bool CCW)
isAngleBetween, checks if angle is between
double _radius
Double _Radius of Arc.
double radius() const
Returns the radius of Arc.
double distanceTo(const geo::Coordinate &c) const
bool isAngleBetween(double angle) const
double startAngle() const
Returns the startAngle.
const Coordinate center() const
Returns center of Arc.