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