W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2017

Re: [csswg-drafts] [css-values] Radians considered useless without π

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Thu, 21 Sep 2017 22:18:49 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-331297515-1506032318-sysbot+gh@w3.org>
Whether trig functions take numbers or angles is a matter of convention. While they arise from circles and angles, their standard definitions (as Taylor series) definitely treat their argument as a plain number, and trig is used in many contexts where angles aren't what's being talked about.  (For example, one way to calculate `e^(i*N)`, a plain number, is `cos(N) + i*sin(N)`.)  I'd probably define them in CSS to take either, actually.  (Outside of CSS, yes, "angles" are actually unitless numbers, dimensional-analysis-wise.)

Anyway, the reason pi is more important there is that so many trig formulas are expressed in terms of it. Requiring the author to convert to tau (using `turn`) makes it more error-prone and harder to read.  Pi is also written explicitly in these formulas, so switching over to a unit-ed value means your formula drifts even further from the original - instead of  writing, say, `sin(5 * pi / 2)`, you have to convert to `sin(5turn / 4)` or something like that.  I think that kicks it over the point where "just use turn" makes sense.  (The latter objection also means that `pirad` as a unit isn't great, tho it's less bad than `turn` in this instance.)

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/309#issuecomment-331297515 using your GitHub account
Received on Thursday, 21 September 2017 22:18:46 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:18 UTC