-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-values] Radians considered useless without π #309
Comments
|
Yes, like I said The idea and benefit of |
Seems like τ-rebels can celebrate a victory then. :) Given that schools all over the world still teach that a unit circle’s circumference is 2π, including Personally, I’m fine with |
Yeah, if the proposal was to add an alias |
No, multiplication by 2 is substantially different than by 180 or 200. The size of numbers matters when doing mental math.
|
Do you have data for usage of |
|
Sorry to be the only negative voice here, but I don't really see the point of adding this. It's not a new feature, it only helps in some mental models. It's just another thing to implement without much benefit. |
The new “feature” is that people would have fewer irrational numbers in their code. This could help to avoid some rounding errors and it would definitely improve user experience for dealing with angles in CSS. |
We already have such a unit, the tau-radian, spelled "turn". (Short for TaURadiaN, obviously; @fantasai plz don't get mad at me for stealing your joke ^_^) Adding pi-radians just to eliminate a factor of two is the hard sell here. (Particularly when the tauradian has additional benefits going for it, namely that it's easy to explain as "one turn around the circle".) |
I feel like we are repeating ourselves, so just this one more time. The proposed benefit is getting rid of the irrational factor of π in I completely agree that tau-based math would be simpler than pi, but that is not what real authors are used to nor what calculators or trigonometric lookup tables are designed to. Nobody will (want to) change their mental model of angles for CSS. ( |
There's no reason to focus on The usefulness of If you're a human, you probably shouldn't be writing |
The Working Group just discussed
The full IRC log of that discussion<dael> topic: Radians considered useless without π<dael> github: https://github.com//issues/309 <dael> astearns: Looks like we want approval to close no change. <dael> fantasai: Basically the argument is you need pi to use radians, but we have turns to you can divide by 2 and use turns. <fantasai> turns = TaURadiaNS <bkardell_> :) <dael> Chris: +1 for closing. I think it's very clear. <dael> Chris: The reason we have radians is people can spit it straight out without converting to degrees first. <dael> astearns: And that there is no impl that wants to add makes me think we should close. <florian> +1 <dael> astearns: Obj to closing no change? <dael> RESOLVED: Close iss #309 no change |
Okay, fine, so lazy JavaScript authors make a use case, but people with normal math education do not. Got it, author experience does not matter. |
That's a completely inaccurate and dishonest read of every comment we've made on this thread. |
The use case was being able to write angles in CSS almost verbatim like everyone does in mathematics. The WG’s resolution is to make authors accept an unfamiliar factor of 2 every time, because that saves each implementor one man-hour or so once. I just wish the CSS WG would adopt HTML’s Priority of Constituencies, because with proposals like this I want the language to become more author-friendly. All I’m ever getting as an answer is a polite variant of “fuck you”. |
I have already scaled back heavily on my W3C activities, for a large part due to frustrating experiences like this. I basically only do small proposals such as this one any more. I haven’t thoroughly reviewed a spec in years because the discouraging feedback I often got (if any). I have seen issues being revisited more than a decade after I (or others who have moved on long ago) suggested to fix them, and been brushed off. The web is full of rants by authors about other annoyances, big and small, that had also been identified early on, and ignored. Many of those cannot be fixed any more; this one can. I really don’t buy your argument and I tried to explain why. The few minutes or hours this would take once to implement in dozens of places by a handful of people do accumulate. I get that. But the seconds saved in writing and reading code by thousands of people in millions of places also accumulate. I’m not claiming that I could estimate the benefits and costs any more accurate than that, but, while CSSWG members probably have better insight in the latter, I strongly feel this imparts their judgment of the former, which is hardly better informed than mine. When in doubt, the Priority of Constituencies would demand that the author-friendly feature be added, but you are convincing yourselves that you were not in doubt in the first place so you can still feel like following that noble principle even when you are really not. I understand that a feature that might be convenient needs additional justification, but I do not understand why a feature that would be convenient also does. Nobody challenged the fact that |
|
There is a constants proposal in #1693, so maybe |
If/when we get trig functions, adding pi is definitely going to be necessary. I wouldn't invest much effort in it until then. ^_^ |
Why would π be any more necessary if CSS had 🤦 |
@Crissov These functions don't work on angles, their parameter is just a real (or complex) number. Using a |
What now? Trigonometric functions always operate on angles! You are just used to implicit In |
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 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 |
For what it’s worth, I agree that this means that |
I wouldn't want (While keywords-in-calc() in general is a difficult topic we haven't solved yet, adding specific keywords is totally fine.) |
As a unit, it could be used wherever |
That's weird, then, because |
Registering a vote for the Pi isn't an angle unit, it's a numerical constant. The angle unit is I don't mind the idea of a simple constant PS, I'd love to have other math constants, like e or especially √2 available in CSS for Shapes and Transforms and so on. All the JavaScript |
@AmeliaBR I mentioned √2 in my initial message, not too sure about the logarithm bases. Designers would more likely need Golden Ratio @tabatkins Multiplication inside |
PS: Just to be clear, having a keyword |
@Crissov The golden ratio is ½ + √(1+¼). |
Should this issue be reopened now that trigonometric functions are coming? #2331 |
@Crissov Maybe? Once we actually get implementations of the trig functions & feedback from people trying to use them, we will see if this is still a sticking point. For myself, even with a |
All the trig functions take both raw numbers and angles (turning those angles into numbers equal to their size in radians), so you can still just use |
For what itʼs worth, basically every CSS preprocessor (extension) that supports trigonometric functions also has a π constant (usually
That is, admittedly, mostly because they need π for calculations themselves. Making it available to users is just a cheap extra, but I think we can assume that at least some authors do use it. While I also saw e and φ in some of the above, I did not see τ, by the way. |
All of those are doing math in raw numbers, where you do indeed need an actual 3.14 (or 6.28 if you want...) to do the math with. Thus, having a $pi or pi() makes perfect sense for them. The CSS functions don't need that, since they have a unitted value and so you can just do your math in tauradians. Piradians would make the formulas accord to what you see in math textbooks slightly better, sure, but until we see people using these functions and complaining about it, we won't worry about adding a new "half-turn" unit. |
Indeed and I already acknowledged that those preprocessors inherently need a respective constant just as much as Javascript needs In the end, however, it still and as always comes down to whether browser vendors, who staff the CSSWG, consider the author benefits worth the implementation costs. Obviously, I am much in favor of additional convenience features like this. Btw., |
Noting that the rest of the JS Math functions:
|
rad
has been a valid angular unit since they have existed in CSS, but it never has been useful or widely used. A major reason for this, despite popular familiarity with degrees, is most probably that values in radians tend to be long floats with a single digit before the decimal marker and hence make authors feel unable to express definite values that won’t be rounded in an unexpected way. (Many intuitively expect decimal rounding, although it’s usually hexadecimal/binary.) This is due to a lack of the constant π in CSS.Although a
turn
unit has already been defined, which equals 2π, I’d like to suggest another unit for radians muliplied by π: eitherpirad
or justpi
. It’s okay to defer it to the next level, although I believe it should already have been included in Level 2.Length units may benefit from other irrational multipliers, e.g. √2, but there’s no obvious identifier comprised of only ASCII letters for them (unless you wanted
1sqrttwomm
). We do have precedents for unit prefixes withdp…
,ms
andkHz
(and if there wasm
, alsomm
andcm
).The text was updated successfully, but these errors were encountered: