lilypond-devel
[Top][All Lists]

## Re: [PATCHES] Re: Harp Pedals?

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

Carl

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

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

Trevor, puzzled ||%-/

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.

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.

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

Solve for a.

substitute into equation (1)

By symmetry, xrad = sqrt(2) a.

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

HTH,

Carl

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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Donnerstag, 28. August 2008 schrieb Valentin Villenave:
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.

Cheers,
Reinhold

- --
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFItxvJTqjEwhXvPN0RAp3YAKDPLWkKDtIwL9kXJ2ewllV145hAiQCfcgtJ
9HT0TA/6i916CtT0vlnWZUk=
=UbNn
-----END PGP SIGNATURE-----

_______________________________________________
lilypond-devel mailing list