RVector RArc::getMiddlePoint() const { double a; a = startAngle + getSweep()/2.0; RVector v = RVector::createPolar(radius, a); v+=center; return v; }
double RArc::getBulge() const { //qDebug() << "sweep: " << getSweep(); double bulge = tan(fabs(getSweep()) / 4.0); if (isReversed()) { bulge *= -1; } return bulge; }
/** * \return Angle length in rad. * * \param allowForZeroLength: Allow for zero length result if start * and end angle are the same. Otherwise 2*PI will be returned for * such an arc, assuming it is a full circle. * * \todo almost the same as getSweep */ double RArc::getAngleLength(bool allowForZeroLength) const { double ret = fabs(getSweep()); // full circle or zero length arc: if (!allowForZeroLength) { if (ret < RS::PointTolerance) { ret = 2 * M_PI; } } else { if (ret > 2 * M_PI - RS::PointTolerance) { ret = 0.0; } } return ret; }
RVector REllipse::getMiddlePoint() const { double a; a = getStartParam() + getSweep()/2.0; return getPointAt(a); }