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

Andreas Lobinger lobingera at gmail.com
Wed Jun 28 10:01:37 UTC 2017


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)
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
others.

On Tue, Jun 27, 2017 at 5:46 PM, David Kastrup <dak at gnu.org> wrote:
> Simon Budig <simon at budig.de> writes:
>
>> Hi David.
>>
>> I understand that this is kind of a clash of philosophies here, and
>> the mathematician in me very much sympathize with you in the sense,
>> that exact representations are helpful and important.
>>
>> But the computer scientist in me thinks, that sometimes "good enough"
>> is good enough...
>
> It wasn't good enough for PostScript, and it wasn't good enough for
> METAFONT, and its author Donald Knuth basically _founded_ computer
> science as a discipline.  It wasn't good enough for SVG.  CSS is
> neutral: you have to specify one of "deg, grad, rad, turn" as unit but
> most tutorials will tell you only about "deg".
>
> The "good enough" faction are engineers.  And even they tend to prefer
> degrees for angles...
>
> Cairo really is the odd man out in graphics software.  I wasn't really
> talking about removing the existing calls, just adding ones working with
> degrees and working _exactly_ where multiples of 90 degrees are
> concerned.
>
> And "good enough" doesn't really cut it in graphics software either when
> we are talking about line thicknesses.  An epsilon of difference may
> easily fatten or thin a line by a whole pixel.  You don't want any
> jaggies anywhere when turning by 90 degrees.
>
> --
> David Kastrup
>
> --
> cairo mailing list
> cairo at cairographics.org
> https://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list