X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fbezier-bow.cc;h=e049bd734c244f78c8411324296514e8de219cc1;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=ccb27d58ea7f76e61cb1f4e00d3718d2821d12e6;hpb=a276a19dc6bd57832db3107f2f2cbb04cb4677b6;p=lilypond.git diff --git a/lily/bezier-bow.cc b/lily/bezier-bow.cc index ccb27d58ea..e049bd734c 100644 --- a/lily/bezier-bow.cc +++ b/lily/bezier-bow.cc @@ -1,9 +1,20 @@ /* - bezier.cc -- implement Bezier and Bezier_bow + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 1998--2015 Jan Nieuwenhuizen - (c) 1998--2007 Jan Nieuwenhuizen + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "misc.hh" @@ -12,7 +23,7 @@ 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 @@ -63,34 +74,34 @@ slur_height (Real width, Real h_inf, Real r_0) slurs. For large slurs, this gives a certain hookiness at the end, so we increase the indent. - indent = G(w) + indent = G (w) - w -> 0, G(w) -> .33 w + w -> 0, G (w) -> .33 w (due to derivative constraints, we cannot have indent > len/3) - w -> inf, G(w) -> 2*h_inf + w -> inf, G (w) -> 2*h_inf i.e. - G(0) = 0 , G'(0) 1/3, G(infty) = 2h_inf + G (0) = 0 , G'(0) 1/3, G (infty) = 2h_inf 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 */ void get_slur_indent_height (Real *indent, Real *height, - Real width, Real h_inf, Real r_0) + Real width, Real h_inf, Real r_0) { Real max_fraction = 1.0 / 3.1; *height = slur_height (width, h_inf, r_0); @@ -106,7 +117,7 @@ slur_shape (Real width, Real h_inf, Real r_0) 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);