I have written a lib for working with colours and stuck trying to calculate Tc(k). From what I have read working in the CIE 1931 XYZ colour space i
Tc(k)
XYZ
I realize this is an old question, but I was struggling to find an answer as well. I finally came across this nifty calculator that also posts the formula as follows:
n = (x-0.3320)/(0.1858-y)
CCT = 437*n^3 + 3601*n^2 + 6861*n + 5517
Hope this helps anyone else who's still looking.