lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implement make-bow-stencil, make-tie-stencil for use in markup-comma


From: thomasmorley65
Subject: Re: Implement make-bow-stencil, make-tie-stencil for use in markup-commands undertie and overtie (issue 270640043 by address@hidden)
Date: Sun, 08 Nov 2015 23:22:51 +0000


https://codereview.appspot.com/270640043/diff/20001/scm/stencil.scm
File scm/stencil.scm (right):

https://codereview.appspot.com/270640043/diff/20001/scm/stencil.scm#newcode88
scm/stencil.scm:88: (sqrt (+ (* width width) (* height height))))
On 2015/11/08 21:22:04, dak wrote:
Is there a reason you are actually taking the absolute values of width
and
height?  You don't need them for calculating the length here.

Not sure what you mean.
Isn't it simple Pythagoras?

https://codereview.appspot.com/270640043/diff/20001/scm/stencil.scm#newcode100
scm/stencil.scm:100: (/ height length-to-print))))
On 2015/11/08 21:22:04, dak wrote:
This looks like a total mess.  Do you even need all this for
something?  What
are you trying to do?

Perhaps express it in words and we'll try finding a direct
representation that
does not need all this juggling with angles and stuff.

You ask for quadrant and angle-start/stop-X-axis, right?

I hoped I had put in enough comments to explain what's done and why,
obviously not sufficient.

In general I have to points P(x1 y1) and Q(x2 y2) and want to create a
bow connecting them.
Therefore I first boil down it, to create a bow from Zero(0 0) to a
point on the (positive-part) of X-axis with with the coordinates
(direct-distance-P-Q 0), because it's far easier to calculate.
After this is done the bow is rotated around Zero to have it the same
orientation like the direct connection of P and Q.
Last step is to move the bow from Zero to P.

For the rotating part I need the value of the angle which depends on the
quadrants of Q relative to P. Calculated using Zero and P moved to
'new-stop'

Hope this is clearer now.

In general I regard the section containing quadrant and
angle-start/stop-X-axis the weakest part of the code.
Any suggestion is highly welcome.

https://codereview.appspot.com/270640043/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]