[cairo] Shouldn't Cairo use/offer degrees rather than radians?
dak at gnu.org
Wed Jun 28 10:34:34 UTC 2017
Andreas Lobinger <lobingera at gmail.com> writes:
> Hello colleague,
> i'm actually not so sure, that PostScript and PDF
> interpreters/rasterizers internally deal with angles in deg, i'd
> rather expect them to use a CTM (and btw: they invented this notation)
Internally? Sure. We were talking about the API.
GS>dak at lola:/usr/local/tmp/lilypond$ gsnd
GPL Ghostscript 9.19 (2016-03-23)
Copyright (C) 2016 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
[0.0 -1.0 -1.0 0.0 0.0 842.0]
GS>1e-20 sin ==
As you can see, small numbers are printable, and specifying right angles
using degrees results in 0 for the respective elements that should be
That is more than Cairo can deliver right now.
> and maybe do what you have presented with the lillypond code (?) to
> deal in coverting from the rotation call to CTM. Which would be my
> recommendation if you see problems using cairo_rotate at exact angles:
> set the CTM manually. I do this for some use of consecutive scaling
> and actually it's quite nice to have an API for that.
> Feel free to provide a patch/API idea for degree interfacing. It's a
> niche problem (i know you disagree) but still might be interesting to
I think for cairo_rotate_deg it would be uncontentious since the degree
representation of the angle does not carry into the internal state.
I'll likely propose a patch along the lines of the code we use in
It will take a bit experimentation to find examples where this can make
For arcs, I don't see a similarly clear-cut approach.
More information about the cairo