[cairo] Shouldn't Cairo use/offer degrees rather than radians?

Bill Spitzak spitzak at gmail.com
Thu Jul 6 18:07:50 UTC 2017


I had to change the format to CAIRO_FORMAT_ARGB32 to get this to work
(otherwise I got CAIRO_STATUS_INVALID_FORMAT) and my output image is
"correct" in that both ends are the same y pixel. The path prints
exactly the same numbers as you show.

I suspect fiddling with your y value would get the error back however.

On Thu, Jul 6, 2017 at 10:37 AM, Andreas Lobinger <lobingera at gmail.com> wrote:
> Hello colleague(s),
>
> On Wed, Jul 5, 2017 at 10:37 PM, David Kastrup <dak at gnu.org> wrote:
>
>> With this print format, the numbers would look the same.  Do they
>> compare equal when comparing them with == ?  And/or can you print with
>> something like 20 significant digits?
>>
>> The reason I ask: if the y coordinates of the curveto are _exactly_
>> identical, this artifact would not actually be a consequence of
>> trigonometric functions unless cairo_copy_path is responsible for
>> minuscule changes as well.
>
> step1: i'm attaching the c-code i used to print the data
> step2: output (with %.20f)
>
> lobi at orange4:~/juliarepo$ gcc attachment1.c -I/usr/include/cairo/ -lcairo
> lobi at orange4:~/juliarepo$ ./a.out
> moveto  20.00000000000000000000,0.50390625000000000000
> curveto 20.00000000000000000000,7.16796875000000000000
> 10.00000000000000000000,7.16796875000000000000
> 10.00000000000000000000,0.50390625000000000000
>
> (and i'm pretty much convinced that path_copy just copies data without
> interfering)
>
> Without further debugging or looking into the code i'd assume we see
> here the process of cairo modeling the arc piecewise by curveto
> operators. And in this case a single curve - regarding the scaling and
> resolution of the output device seems to be enough.
>
> step3: please run and post. I'm really interested how your cairo is
> creating a different curve.
>
> --
> cairo mailing list
> cairo at cairographics.org
> https://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list