Esempio n. 1
0
/*---------------------------------------------------------------*/
static double calcTheta(double ki, double kf, double two_theta){
  /**
   *               |ki| - |kf|cos(two_theta)
   * tan(theta) = --------------------------
   *                |kf|sin(two_theta)
   */
  return rtan(ABS(ki) - ABS(kf)*Cosd(two_theta),
	      ABS(kf)*Sind(two_theta))/DEGREE_RAD;
}
Esempio n. 2
0
/**
 * \return Tangent angle of spline at end point.
 */
double RSpline::getDirection2() const {
    if (!isValid()) {
        return 0.0;
    }
    updateInternal();

#ifndef R_NO_OPENNURBS
    ON_3dVector ontan = curve.TangentAt(getTMax());
    RVector rtan(ontan.x, ontan.y);
    return RMath::getNormalizedAngle(rtan.getAngle() + M_PI);
#else
    return 0.0;
#endif
}