-void
-Bezier_bow::to_canonical_form ()
-{
- origin_ = encompass_[0];
- translate (&encompass_, -origin_);
-
- Offset delta = encompass_.top () - encompass_[0];
- alpha_ = delta.arg ();
-
- rotate (&encompass_, -alpha_);
- if (dir_ == DOWN)
- {
- flip (&encompass_, Y_AXIS);
- }
-
- while (encompass_.size () > 1 && encompass_[1][X_AXIS] <= 0.0)
- {
- programming_error ("Degenerate bow: infinite steepness reqd");
- encompass_.del (1);
- }
-
- Real l = encompass_.top ()[X_AXIS];
- while (encompass_.size () > 1 && encompass_.top (1)[X_AXIS] >= l)
- {
- programming_error ("Degenerate bow: infinite steepness reqd");
- encompass_.del (encompass_.size ()-2);
- }
-}
+/*
+ ^ x x
+ |
+ height <indent>
+ |
+ v x x
+
+
+
+ For small w, the height should be proportional to w, for w ->
+ infinity, the height should rise to a limit asymptotically.
+
+ Hence we take F (x) such that
+ F (0) = 0 , F' (0) = 1, and F (infty) = 1
+
+ and use
+
+ h = h_infinity * F (x * r_0 / h_infinity)
+
+
+ Examples:
+
+ * F (x) = 2/pi * atan (pi x/2)
+
+ * F (x) = 1/alpha * x^alpha / (1 + x^alpha)
+
+ * (etc.)
+
+ [with the 2nd recipe you can determine how quickly the conversion from
+ `small' slurs to `big' slurs occurs.]
+
+ Although this might seem cand_idates to SCM-ify, it is not all clear
+ which parameters (ie. h_inf, r_0, F (.)) should be candidates for
+ this. At present h_inf and r_0 come from layout settings, but we did
+ no experiments for determining the best combinations of F, h_inf and
+ r_0.
+
+
+ The indent is proportional to the height of the slur for small
+ slurs. For large slurs, this gives a certain hookiness at the end,
+ so we increase the indent.
+
+ indent = G (w)
+
+ w -> 0, G (w) -> .33 w
+
+
+ (due to derivative constraints, we cannot have indent > len/3)
+
+ w -> inf, G (w) -> 2*h_inf
+
+ i.e.
+
+
+ G (0) = 0 , G'(0) 1/3, G (infty) = 2h_inf
+
+ solve from
+
+ G (w) = r + p/(w+q)
+
+ yields
+
+ G (w) = 2 h_inf - max_fraction * q^2/ (w + q)
+
+ with q = 2 h_inf
+*/