-
Notifications
You must be signed in to change notification settings - Fork 746
Description
Since predefined constants inside calc()
, starting with pi
for π and e
(natural logarithm base), are now a thing #4688, there should also be phi
for φ or ϕ which denotes calc((sqrt(5) + 1)/2)
= ½+√1¼ ≈ 1.618034, i. e. the Golden Number (also known as Golden Ratio or Golden Mean) which is used a lot in graphic design, although often approximated by more practical, rational values between 1.6 (8:5) and 1.625 (13:8), e. g. in aspect ratios.
Itʼs such an obviously sensible addition that others have informally suggested it as well, of course, e. g. on Twitter.
It is not available in ECMA-262 yet, i.e. as a predefined constant in the Javascript Math
object.
Other constants that are not being proposed
I can think of no other irrational factor frequently used in design that is not easily expressed as sqrt()
with a simple argument like 1.5, 2, 3 and 5 or their inverse values.
The Silver Ratio is 1+sqrt(2)
, which is a little bit more complex, but is neither used very often nor does it have a commonly known symbol – δs would become delta-s
which is just one character shorter.
The definition of the Platin Number (ρ or ϱ, rho
, ca. 1.324717) is a lot more complex, but is neither well known nor often used.
The other metallic means, (p+sqrt(4*q+p*p))/2
with small integers p
and q
, are either simple numbers or not important at all. (p = q = 2 for platinum)
tau
τ = 2π is too simple to deserve a designated constant of its own and itʼs already available as the angular unit turn
anyway.
Uppercase Φ is usually just 1-phi
= -1/phi
, sometimes also defined as phi-1
= 1/phi
, but since CSS is case-insensitive here, it couldnʼt be added anyway.
theta
θ or ϑ is sometimes defined as sqrt(pi)*phi
, which is both now simple to write if one needs it and too hardly known otherwise.
There are, however, some standard angles, including the Golden Angle of c. 137.5deg
or c. 2.4rad
, that might make sense to add, but they would deserve an issue of their own.