double RArc::getAngleAt(double distance, RS::From from) const { QList<RVector> points = getPointsWithDistanceToEnd(distance, from); if (points.length()!=1) { return RNANDOUBLE; } return center.getAngleTo(points[0]) + (reversed ? -M_PI/2 : M_PI/2); }
double RSpline::getAngleAt(double distance, RS::From from) const { QList<RVector> points = getPointsWithDistanceToEnd(distance, from); if (points.length()!=1) { return RNANDOUBLE; } double t = getTAtPoint(points[0]); ON_3dVector v = curve.DerivativeAt(t); return RVector(v.x, v.y).getAngle(); }
/** * \return Point at given percentile. */ RVector RShape::getPointAtPercent(double p) const { double length = getLength(); double distance = p * length; QList<RVector> candidates = getPointsWithDistanceToEnd(distance, RS::FromStart); if (candidates.length()!=1) { return RVector::invalid; } return candidates.at(0); }