Re: [csswg-drafts] [css-values] Math Constant phi for Golden Ratio (#4702)

Hi @Crissov  

Just stumbled onto this thread — interestingly, I am using phi as the output contrast scale factor in [APCA and SAPC](https://github.com/Myndex/SAPC-APCA), to put contrast at easy to remember values (60, 80, 100, 120). It's there with a simple JS:`const scale = 1.618;` Trivial, and not like pi where 20 places can be important, such a when calculating LCh. 

JS Math has pi as a property, but not phi. I happen to like phi as a number myself, but I don't see needing it as a standard value for JS much less CSS. Sure, you'll see pi often, but not phi. _Why??_

## Here's Why

**pi is difficult to calculate.** In fact it's a pain in the ass. And having pi at your fingertips to the maximum precision of your environment is very useful.

phi is also useful, but it is also **trivially easy to calculate:**

     (1 + sqrt(5)) / 2  =  1.6180339887498948482045868343656381177203091798

And secondly, phi is less likely to cause a rounding error. Let's compare to pi:

    pi(48) vs phi
    3.1415926535897932384626433832795028841971693993
    1.6180339887498948482045868343656381177203091798

Notice anything? Rounding phi to 3, 4, or 5 places really changes nothing. But that is not true for pi at all.

It's easy to remember 1.618, harder to remember 3.14159, and much harder to remember is 3.14159265358979 but this last one is what you need for a lot of common math if you want to avoid noisy rounding errors.

### SO YAY for phi φ — the magical golden number that's also easy to remember...

:)

Andy
_Inventor of APCA and SAPC_
_And guy obsessed with color... and also math apparently..._

-- 
GitHub Notification of comment by Myndex
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4702#issuecomment-734776581 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 27 November 2020 10:57:11 UTC