lilypond-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: not-so-ancient flags


From: Carl D. Sorensen
Subject: Re: [PATCH] Re: not-so-ancient flags
Date: Sat, 13 Dec 2008 08:56:47 -0700



On 12/13/08 6:48 AM, "Reinhold Kainhofer" <address@hidden> wrote:

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

I can't help on three of them, but I can help on one....
> 
> However, I'm running into some problems:
> - -) How can I obtain the line-thickness. It's not a property of the stem grob
>     and in the flag formatting function I don't have the curent layout object
>     available...
> - -) How can I obtain the width of a black notehead? In particular, for grace
>     notes the flag needs to be scaled according to the note head, so the
>     staff-space can't be used for this.
> - -) What's the best way to convert an angle/length pair of polar coordinates
>     (angle given in degree) to cartesian coordinates in scheme / guile? I
>     don't want it as a complex number, but as a pair of reals...

Here's code that works; I can't promise it's the *best* way:

(define (polar->rectangular polar-pair)
 "Convert @code{polar-pair}, a pair containing (magnitude .
angle-in-degrees)
to (x-length . y-length)"
  (let* ((conversion-constant (/ (atan 1 1) 45))
         (length (car polar-pair))
         (angle (* conversion-constant (cdr polar-pair))))
     (cons
        (* length (cos angle))
        (* length (sin angle)))))


HTH,

Carl





reply via email to

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