On 12/13/08 6:48 AM, "Reinhold Kainhofer" <reinh...@kainhofer.com> 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



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to