[Top][All Lists]

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

Re: [PATCHES] Re: Harp Pedals?

From: Trevor Daniels
Subject: Re: [PATCHES] Re: Harp Pedals?
Date: Fri, 29 Aug 2008 09:03:24 +0100


Why not use an ellipse that just fits _inside_ the rectangle?

Then a^2/xrad^2 = 1; so xrad = a
and  b^2/yrad^2 = 1; so yrad = b

The values of x-extent and y-extent of the grob are also given

Trevor, puzzled ||%-/

----- Original Message ----- From: "Carl D. Sorensen" <address@hidden> To: "Reinhold Kainhofer" <address@hidden>; "Valentin Villenave" <address@hidden>
Cc: <address@hidden>
Sent: Friday, August 29, 2008 4:17 AM
Subject: Re: [PATCHES] Re: Harp Pedals?

I want the equation of an ellipse that circumscribes a box 2a by 2b.

x^2/xrad^2 + y^2/yrad^2 = 1 (ellipse)

needs to pass through the points (a,b), (-a,b), (a,-b), (-a,-b).

Because of the squared terms, all four points have the same equation.

a^2/xrad^2 + b^2/yrad^2 = 1  (1)

There is an infinite number of ellipses that circumscribe the ellipse.

I want one with the aspect ratio being the same as the box.  So my second
equation is

q/b = xrad/yrad

Solve for a.

a = b* xrad/yrad

substitute into equation (1)

b^2*xrad^2/(yrad^2*xrad^2) + b^2/yrad^2 = 1

2b^2/yrad^2 = 1

yrad^2 = 2b^2

yrad = sqrt(2) b.

By symmetry, xrad = sqrt(2) a.

Your counterexample didn't apply because of the 0 in the denominator.



On 8/28/08 3:42 PM, "Reinhold Kainhofer" <address@hidden> wrote:

Hash: SHA1

Am Donnerstag, 28. August 2008 schrieb Valentin Villenave:
2008/8/19 Carl D. Sorensen <address@hidden>:
I've been looking at ellipse code.  Once I can get rhythms.itely off my
plate (which is waiting on the beatGrouping patch, one way or the other)
I'll add an ellipse in place of the circle.

I've been looking at a way to draw ellipses, but I've just seen you
have pushed a much better-looking implementation than mine; I hope the
docs will be recompiled soon so we can appreciate your nice ellipse in
the documentation!

Yes, I saw that, too. I even generalized it to allow different paddings in X- and Y-direction. However, what I don't understand about the ellipse code in ellipse-stencil is the factor 0.707 (supposedly from sqrt(2)/2) for x-radius
and y-radius. If that factor comes from scaling the ellipse so that it
surrounds the stencil, then it only works for square stencils, for all other
stencils it will be too large. As an extreme case consider a line stencil
("box" from (0 . -1) to (0 . 1) ). The ellipse will have half-axes of length
1.414 and 0 (without padding), so in X-direction it will overshoot by far.

For a square, of course, the ellipse will degenerate to a circle, touching all
corners, but for stencils with other rectangular extents, the ellipse will
not touch the corners of the bounding box any more.


- --
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden,
* Financial and Actuarial Mathematics, TU Wien,
 * K Desktop Environment,, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien",
Version: GnuPG v1.4.6 (GNU/Linux)


lilypond-devel mailing list

reply via email to

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