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

David Kastrup <[email protected]>
Newsgroups gmane.comp.lib.cairo
Organization Organization?!?
Message-ID <[email protected]>
PostScript uses degrees.  PDF uses degrees.  Either have a numerically
stable presentation of right angles, the most important angles a
rectilinear coordinate system can work with.

In contrast, Cairo uses radians.  For every floating point format, PI/4
has different multiples, as opposed to 45.  You don't get guarantees
like

(1.5*M_PI/2 - M_PI) == 0.5 * M_PI

which means that detecting almost any kind of right angle reliably is a
gamble.

sin(0) = 0 in either radians or degrees, and sin(x) approximately equal
to x for small x is what makes radians popular mathematically.  But
"approximately equal" is fine to suffer from numeric aberrations, in
contrast to the relations that radians are not able to reliably provide
in standard floating point.

Representing angles as turns (with 1.0 representing an angle of 2\pi)
would also be numerically stable for important angles (though not for
the less important 30 or 60 degrees) but it hasn't caught on anywhere.

So why not provide degrees (and use them internally) for Cairo?

-- 
David Kastrup

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