Re: Shouldn't Cairo use/offer degrees rather than radians?

Lawrence D'Oliveiro <[email protected]>
Newsgroups gmane.comp.lib.cairo
Organization Geek Central
Message-ID <[email protected]>
On Tue, 27 Jun 2017 11:37:07 +0200, David Kastrup wrote:

> If I write
> 
> #include "math.h"
> #include "stdio.h"
> 
> int
> main ()
> {
>   printf ("%lg\n", cos (M_PI/2));
>   return 0;
> }
> 
> and run it, the output is 6.12323e-17 .

Which, with any reasonable pixel resolution that Cairo might be
expected to cope with, is indistinguishable from zero.

> If you want to turn something by exactly 90 degrees or 180 degrees
> (not exactly a rare event in graphics), you cannot do so by using a
> Cairo function accepting angle arguments but have to specify the
> transform matrix manually.

On the contrary: specifying angles of ±90/±180 or ±0.5π/±π works just
fine. You can try it out for yourself with my “Matrix Basics”
interactive notebook <https://github.com/ldo/qahirah_notebooks>.
-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.