- BEZIER_BOW_DEBUG_OUT << "begin " << begin_p[X_AXIS] << ", " << begin_p[Y_AXIS] << endl;
- BEZIER_BOW_DEBUG_OUT << "end " << end_p[X_AXIS] << ", " << end_p[Y_AXIS] << endl;
-
- Real height =control_[1][Y_AXIS];
- for (int i = 0; i < encompass_.size (); i++ )
- height = height >? encompass_[i][Y_AXIS];
-
- // emperic computer science:
- // * tangents somewhat steeper than minimal line
-#ifndef STANDALONE
- Real internote = paper_l_->get_realvar (interline_scm_sym)/2.0;
- Real rc_correct = paper_l_->get_var ("slur_rc_factor");
-#else
- Real internote = STAFFHEIGHT / 8;
- Real rc_correct = 2.4;
-#endif
-
- begin_rc *= rc_correct;
- end_rc *= rc_correct;
- Real rc1 = begin_rc;
- Real rc2 = -end_rc;
-
- Real begin_alpha = atan (begin_rc);
- Real end_alpha = atan (-end_rc);
- Real theta = (begin_alpha - end_alpha) / 2;
-
- Real epsilon = internote / 5;
-
- // if we have two disturbing points, have height line through those...
- if (!((abs (begin_p[X_AXIS] - end_p[X_AXIS]) < epsilon)
- && (abs (begin_p[Y_AXIS] - end_p[Y_AXIS]) < epsilon)))
- theta = atan (end_p[Y_AXIS] - begin_p[Y_AXIS]) / (end_p[X_AXIS] - begin_p[X_AXIS]);
-
- Real rc3 = tan (theta);
- // ugh: be less steep
- rc3 /= 2*rc_correct;
-
- Real c2 = -rc2 * control_[3][X_AXIS];
- Real c3 = begin_p[Y_AXIS] > end_p[Y_AXIS] ? begin_p[Y_AXIS]
- - rc3 * begin_p[X_AXIS] : end_p[Y_AXIS] - rc3 * end_p[X_AXIS];
-
- BEZIER_BOW_DEBUG_OUT << "y1 = " << rc1 << " x + 0" << endl;
- BEZIER_BOW_DEBUG_OUT << "y2 = " << rc2 << " x + " << c2 << endl;
- BEZIER_BOW_DEBUG_OUT << "y3 = " << rc3 << " x + " << c3 << endl;
- control_[1][X_AXIS] = c3 / (rc1 - rc3);
- control_[1][Y_AXIS] = rc1 * control_[1][X_AXIS];
- control_[2][X_AXIS] = (c3 - c2) / (rc2 - rc3);
- BEZIER_BOW_DEBUG_OUT << "c2[X_AXIS] = " << control_[2][X_AXIS] << endl;
- BEZIER_BOW_DEBUG_OUT << "(c3 - c2) = " << (c3 - c2) << endl;
- BEZIER_BOW_DEBUG_OUT << "(rc2 - rc3) = " << (rc2 - rc3) << endl;
- control_[2][Y_AXIS] = rc2 * control_[2][X_AXIS] + c2;
- BEZIER_BOW_DEBUG_OUT << "c2[Y_AXIS]" << control_[2][Y_AXIS] << endl;
-
- calc_return (begin_alpha, end_alpha);