In a meeting conducted last month, the CSS Working Group has agreed on introducing a few trigonometry functions in CSS. Created in 1997 by the World Wide Web Consortium (W3C), the CSS Working Group is responsible for discussing new features and tackling issues in CSS.
Currently, they have approved the following 10 functions:
- 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()
- Power of: pow()
CSS is no longer just limited to changing colors or fonts. Developers have been slowly relying on CSS for implementing much more complex tasks. CSS 3, its overhauled version, comes with several web animations, gradients, certain selectors, and more. However, CSS lacked the ability to work with angles and perform much more advanced mathematical operations than adding, subtracting, multiplying, or dividing two values.
This decision comes after multiple requests by web developers to introduce trigonometric functions for simplifying implementations of many use cases that involve angles. These will be very handy in cases like syncing rotation angles, converting between angles and x/y dimensions, and more.
Read the discussion by CSS Working Group, check out its GitHub repository.