|
|
>Given that you know the total length you can use 2*pi*r (perimeter of a
>circle) and the fact that 2*pi*r*360/angle = length
This is only true in the limit as the number of characters approaches
infinity. He's only got the lengths of the chords, not of the arcs.
The length of a chord is 2*r*sin(angle/2). So the equation is:
_ n
\ -1
> 2*sin (chord / (2*r)) = 360 (or 2*pi, if you use radians)
/_ i
i=1
And he's hoping to find r. That doesn't look very easy to me. I think
the only solution might be an iterative one. Your answer gives a good
lower bound for r; I'm not sure what a good upper bound would be.
I'm also not sure this is the right group for this question; he might
find better answers in .advanced-users.
Also, as an aside to the original poster, how about writing this routine
as a macro using min_extent and max_extent instead of modifying truetype.c?
The result will be the same without having to make a new patch, and you
might even be able to offer more options (such as an optional angle
that can be used to rotate each character around the x axis before moving
it to its final position, making a cone shape or a cylinder instead of a
flat circle)
--
These are my opinions. I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html
Post a reply to this message
|
|