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

Andreas Lobinger lobingera at gmail.com
Thu Jul 6 17:37:33 UTC 2017


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: attachment1.c
Type: text/x-csrc
Size: 1352 bytes
Desc: not available
URL: <https://lists.cairographics.org/archives/cairo/attachments/20170706/f1a9a400/attachment.c>


More information about the cairo mailing list