X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbezier-bow.cc;h=d9510704eef33f1955c9b79934bb1a1f26d9d369;hb=5d1d077e3d4f49fd822d3c04e785eee4be06a7fc;hp=044a898d07bb837d5967390de2889c52706d5bd5;hpb=b782f68f927fa02b3ea895dd1bd801082e5bda6e;p=lilypond.git diff --git a/lily/bezier-bow.cc b/lily/bezier-bow.cc index 044a898d07..d9510704ee 100644 --- a/lily/bezier-bow.cc +++ b/lily/bezier-bow.cc @@ -3,19 +3,16 @@ source file of the GNU LilyPond music typesetter - (c) 1998--2004 Jan Nieuwenhuizen + (c) 1998--2006 Jan Nieuwenhuizen */ -#include - #include "misc.hh" #include "bezier.hh" - static Real F0_1 (Real x) { - return 2 / M_PI * atan (M_PI * x / 2); + return 2 / M_PI *atan (M_PI *x / 2); } Real @@ -24,17 +21,15 @@ slur_height (Real width, Real h_inf, Real r_0) return F0_1 (width * r_0 / h_inf) * h_inf; } - /* - - - ^ x x +/* + ^ x x | -height + height | - v x x + v x x + + - - For small w, the height should be proportional to w, for w -> infinity, the height should rise to a limit asymptotically. @@ -45,7 +40,7 @@ height h = h_infinity * F (x * r_0 / h_infinity) - + Examples: * F (x) = 2/pi * atan (pi x/2) @@ -72,7 +67,7 @@ height w -> 0, G(w) -> .33 w - + (due to derivative constraints, we cannot have indent > len/3) w -> inf, G(w) -> 2*h_inf @@ -84,27 +79,24 @@ height solve from - G(w) = r + p/(w+q) + G(w) = r + p/(w+q) yields - G(w) = 2 h_inf - max_fraction * q^2/ (w + q) + G(w) = 2 h_inf - max_fraction * q^2/ (w + q) - with q = 2 h_inf - - - */ + with q = 2 h_inf +*/ void get_slur_indent_height (Real *indent, Real *height, Real width, Real h_inf, Real r_0) { Real max_fraction = 1.0 / 3.1; - *height = slur_height (width, h_inf, r_0); + *height = slur_height (width, h_inf, r_0); - Real q = 2 * h_inf / max_fraction; - *indent = - 2 *h_inf - sqr (q) * max_fraction / (width + q); + Real q = 2 * h_inf / max_fraction; + *indent = 2 * h_inf - sqr (q) * max_fraction / (width + q); } Bezier @@ -112,9 +104,9 @@ slur_shape (Real width, Real h_inf, Real r_0) { Real indent; Real height; - + get_slur_indent_height (&indent, &height, - width, h_inf, r_0); + width, h_inf, r_0); Bezier curve; curve.control_[0] = Offset (0, 0);