CSS To Get Support For Trigonometry Functions (zdnet.com) 135
CSS, or the language that styles and arranges how page elements appear on a website, will soon get support for trigonometry functions such as sine, cosine, tangent, and others, ZDNet is reporting. From the report: The new trigonometry functions were approved at the end of February in a meeting of the World Wide Web Consortium (W3C) CSS Working Group. The new functions approved and set to join the CSS standard are: Sine - sin(), cosine - cos(), tangent - tan(), arccosine - acos(), arcsine - asin(), arctangent - atan(), arctangent (of two numbers x and y) - atan2(), square root - sqrt(), square root of the sum of squares of its arguments - hypot(), and power of - pow().
pfft (Score:4, Funny)
Re: (Score:2)
Sure. The vast majority of stats is adding and subtracting. Square roots are handy though.
Re: (Score:2)
Edit: adding, subtracting, multiplying and dividing.
Why? (Score:2)
Re: (Score:2)
CSS is meant to make pages prettier.
That's one thing it can do, but CSS is also the main tool for setting up different page layouts, and not everything has to be a rectangular grid.
Re:Why? (Score:5, Informative)
Re: (Score:3, Insightful)
Great, because the average webpage didn't use enough CPU time without this.
Re: Why? (Score:1)
Trig functions are stupid easy for CPUs to work with. 15 years ago we were well into the era when many games were using trig to transform audio in real-time purely in software. Even today's el cheapo smartphones would brush that off, and that's way more complex than what your typical web developer would need.
Re: (Score:1)
Trig functions are stupid easy for CPUs to work with. 15 years ago we were well into the era when many games were using trig to transform audio in real-time purely in software. Even today's el cheapo smartphones would brush that off, and that's way more complex than what your typical web developer would need.
Said nobody ever.
While you can use lookup tables for stupidly fast sine, cosine and tangent functions you still have to do the hard yards for sqrt(). This is why most game engines doing bounds checks don't use c = sqrt((a * a) + (b * b)), they put up with cSquared = (a * a) + (b * b). Same result list, much cheaper maths.
Re: (Score:1)
Unless you're doing something truly weird, your CPU isn't spending much time at all on even heavy web browsing. Even the heaviest of web pages are not going to exceed a few % usage of your cpu. A lot of people around here seem to base a lot of their perceptions and priorities on what things were like 15 years ago.
Re:Why? (Score:5, Funny)
A lot of people around here seem to base a lot of their perceptions and priorities on what things were like 15 years ago.
That's pretty much Slashdot in a nutshell. Shoot, say something like systemd, wayland, Java performance, IPv6 deployment, or cloud computing and you're likely to get a stack of punch cards thrown at you for being a heretic.
Re:Why? (Score:4, Funny)
Punch cards? Damned whippersnappers. Paper tape is all you need you little snots! Now, get off my lawn!
Re: (Score:2)
Unless you're doing something truly weird, your CPU isn't spending much time at all on even heavy web browsing. Even the heaviest of web pages are not going to exceed a few % usage of your cpu. A lot of people around here seem to base a lot of their perceptions and priorities on what things were like 15 years ago.
Percentages might look low but typically it's because only a single thread of execution is being utilized. I routinely find myself in CPU limited territory when viewing large tables of data from browser.
Re: (Score:3)
More importantly, if you have sine, you can easily incorporates circles into your layout. A whole new class of stylish but unintuitive interface is open now!
Re: (Score:1)
More importantly, if you have sine, you can easily incorporates circles into your layout.
x^2 + y^2 = r^2 is enough for circles without trig.
Re: (Score:2)
Now try rewriting that to do polar to Cartesian coordinate transform.
Re: (Score:2)
Ho nice! It will be easier to add more useless animations that add _nothing_ useful to web pages. Please add bouncing cats all over the web pages! :)
Re: (Score:2)
Re: (Score:1)
You're doing it wrong.
CSS is a declarative language for layout. It works ok for static layouts. Dynamic elements stretch its limits - simple things are doable, but the complexity ramps up quickly. If you're using it for animation, you're using the wrong tool for the job.
To web developers, CSS is like XML (and violence): if it doesn't solve your problem, just use more. A pox on the lot of them.
Re: (Score:3)
If you're using it for animation, you're using the wrong tool for the job.
Then what is the right tool for the job, particularly if you're site's audience includes the sort of "I don't want any script in the browser, ever" tech purists who inhabit Slashdot?
Re: (Score:1)
Do you think turning CSS into Javascript will please the people who don't want to run Javascript, or just sour them on CSS?
Re: (Score:2)
Maybe they could create a new browser-specific language designed to handle trivial in-page tasks, and ONLY trivial in-page tasks?
You know, like Javascript *used* to be before they kept extending it and extending it beyond all reasonable limits and turning it into the ginormous mess that people are now trying to get away from?
"Mod it till it breaks" is fine for Bethesda games, but it's been a never ending series of trainwrecks in the rest of the computer industry.
Re: (Score:2)
Actually, I was assuming something similar. The "I don't want any script in the browser, ever" crowd is the eventual target as the slowly add enough to be able to do the things in CSS that people hates flash & javascript for. They aren't there yet, but I wonder how far they are from it?
Can they implement CSS "Punch the monkey"? Can they embed CSS tracking IDs? Can they obscure link actual link targets with it? Can the exfiltrate information with it?
Re: (Score:2)
Aaahhhh ahhhhhh! Flash!
Re: (Score:2)
Savior of the Universe!
Re: (Score:2)
No, it is NOT needed. You should be doing this in JavaScript -- not in a (static) layout language.
Where will this bloat end? Adding a scripting language??? Because there will always be some "wouldn't it be nice to be able to do ...". We _already_ have requestAnimationFrame [mozilla.org] for smooth, jank free 120 Hz animation. To see if your browser supports 120 fps check use testufo [testufo.com].
Re: (Score:2)
We _already_ have requestAnimationFrame
Not if the user has chosen to disable script on your site for any of several reasons:
- Wanting to maintain a sense of separation between documents, which ought to be static on the client side (even if they are dynamic on the server side), and applications, which ought to be native and downloadable
- Fear of being tracked, particularly through the subpoena exception in every privacy policy
- Your scripts not having been marked as licensed under a free software license [gnu.org]
Re: (Score:2)
If you're doing 3d transformations in CSS, these are very helpful.
Re: (Score:2)
Heck, they're very useful for 2D transformations. It's almost impossible to rotate something in 2D without using trig.
Frankly, I'd say anyone who works with computer generated/animated graphics, and doesn't already understand the usage and value of trig functions, has missed an incredibly important part of their education that should be rectified as soon as possible.
Re: (Score:2)
Even in a newspaper, not everything benefits from a rectilinear layout.
Re: (Score:2)
Please don't say that animations make things more intuitive. Every web page today is trying desperately to mimic what they were doing in Flash 15 years ago, and it's not any more intuitive today using HTML5 than it was back then using single-threaded proprietary technology.
Why not? (Score:2)
Seriously, why? CSS is meant to make pages prettier. Does it need math functions? Are they going to make turing complete?
You do realize that EVERYTHING on a computer is a math function sooner or later, right? Any why not have math functions? Just because you can't think of a use for it doesn't mean nobody else can. SVG and MathML make use of CSS and the utility there seems fairly straightforward. Can you not imagine CSS math functions being used to display math data better than it is now?
Re: (Score:2)
Because any time you want to move or place anything in a not-perfectly-vertical-or-horizontal straight line, trigonometry is the natural solution. You can kludge together various alternatives, but trig handles everything seamlessly and consistently. They are the fundamental tools necessary for translating back and forth between rectangular grid coordinates, and angle-and-distance polar coordinates.
You can do computer graphics and animations without them, but it's like juggling with your hands tied behind
Re: (Score:2)
Soon you will mine cryptocrrency with CSS (Score:5, Funny)
Re: (Score:1)
Just wait until CSS has new features designed SPECIFICALLY to support advertising! It will be amazing and wonderful! Ads like you've never seen before! Especially if CSS can pull in ads with executable code from third party web sites!
Re: (Score:2)
interesting (Score:3, Insightful)
Taking javascript out of the equation is more than welcome.
Re: (Score:2)
Until CSS becomes the next Javascript cause people keep feeling the need to extend it well beyond what it was ever intended to go.
Kinda like what happened to Javascript, as a matter of fact.
Objokes (Score:5, Funny)
A nerd was invited to compete in the Trigonometry Mathletic Competition...
he said:
"Sine me up!"
Catholics fail trigonometry because they're afraid of sin
Irish people fail trigonometry because they can't tan.
Everyone else fails trigonometry just cos.
My girlfriend has a trigonometry fetish.
Every time we talk, she gets off on a tangent.
My teacher frowned at me when I handed in my trigonometry test paper.
I don't think that's a good sine
Re: (Score:1)
Trigonometry puns are a sine of insanity.
Re: (Score:2)
And baby, that's all there is to the cosine craze
-The Beach Boys
(O.K., I know the lyric is supposed to be "coastline", but that's how it always sounds to me.)
English, do you speak it? (Score:2)
Noun adjunct (attributive noun; noun [pre]modifie) (Score:1)
English is a powerful language, which is one of the reasons why it dominates our planet; it has many tools, one of which is the adjunct noun [wikipedia.org] (or "attributive noun", or "noun [pre]modifier").
Re: (Score:2)
Prescriptivists would claim that the existence of "trigonometric" makes it nonstandard to use "trigonometry" as an adjunct noun.
Re: (Score:2)
the functions themselves are called trigonometric
Except for the cyclometric ones?
read the original github issue (Score:2)
[css-values] Trigonometric functions #2331 [github.com]
The contributor documents potential use cases in his opening post, and a little later on, the irc log is visible
Re: (Score:1, Flamebait)
AmeliaBR: Once you start doing graphical layouts involving arcs and stuff, you need trig functions to convert from width/height distances to angular distances
Translation: my website is only massively annoying. I need it to be even more annoying than previously thought possible, and the CPU need to be pegged permanently at 100%.
Trigonometry functions?! (Score:5, Insightful)
How about adding support for simple constants first?!
const myColor=#0F0;
body
{
background: myColor;
}
Yes, I know... CSS pre-processors, yadda yadda yadda... but every time you add a tool to your system, it's another security risk, another thing to slow your system down.
Re:Trigonometry functions?! (Score:5, Informative)
Alas, as long as you need support for dreaded IE11, you're out of luck: https://caniuse.com/#feat=css-... [caniuse.com]
Re: (Score:2)
You know what's ironic? That fucking caniuse website doesn't even work with Safari 9.1.3, which is barely three years old.
What are people fucking doing that a three years old browser can't even display basic content?
Re: (Score:2)
Re: (Score:2)
That doesn't negate the fact that the website displays their interface but does not display the requested item.
It's like everything is going through javascript these days for no fucking reason.
Re: (Score:2)
And when will HTML support come? (Score:1)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Time for CSS to become a real programming language with variables and functions.
CSS is a domain specific language not a general purpose language.
Re: (Score:2)
Yeah (Score:1)
The real question... (Score:2)
The real question is, when will I get support for trig functions?
Re: (Score:2)
As soon as you sit down and learn them. Here, this image contains most of the information that you need to effectively use basic trig, and will help you to visualize how the primary trig functions interact: https://commons.wikimedia.org/... [wikimedia.org]
sine and cosine are probably the most important ones, as they decompose angle-and-distance polar coordinates into (x,y) rectangular ones, and it's extremely difficult to perform rotations or general-case not-perfectly-horizontal-or-vertical translations without them.
Sweet (Score:2)
Such odd priorities (Score:5, Insightful)
The file upload button is unstylable. People write crazy amounts of browser-specific code to get around this - literally hundreds of lines of code, if you want to work responsively in all current browsers - because every other button can have style applied to it, but file upload buttons can't.
Seriously. Working on trig functions when they haven't finished with buttons yet? That seems really strange to me.
Re: (Score:2)
The file upload button is unstylable.
This is entirely by design, and there's actually an excellent reason for it.
Re: (Score:2)
Oh just fuck off (Score:1)
Great so now things will be even slower and more CPU intensive just so we can put more rounded edges and stupid starwipes into what should be simple interfaces.