Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm calculating the Correlated Color Temperature (CCT) from a chromacity pair, and I am trying to find how far from the Planckian Locus the coordinates are.

What I'm currently doing is I read RGB values off a sensor, I do a matrix transformation to get to XYZ. Then I calculate the xy values, and lastly I use McCamy’s formula to get CCT.

McCamy’s formula gives me the Correlated Color Temperature, the nearest point along the Planckian Locus for the xy coordinates (roughly a orange to blue axis). I am trying to find the green/magenta content of the light, so I need to find how far from the locus the coordinates are (roughly a green to magenta axis).

I guess McCamy’s formula finds the normal down to the locus, and that I need to calculate how long that normal is. I also have to do it fast (this is running on a small embedded processor). I'm using the CIE 1931 color space. (EDIT: The illustration is from CIE 1960 as pointed out below, but I could not find a chart showing isothermal lines for CIE 1931)


share|cite|improve this question
up vote 2 down vote accepted

I'm a bit confused because you write that you calculate the CCT using $xy$ values using McCamy's formula (I'm assuming you mean this formula), but you included a diagram of the Planckian locus in $uv$, not in $xy$. Presumably when you say you're trying to find how far from the Planckian locus the coordinates are, you're referring to the Euclidean distance either in $xy$ space or in $uv$ space? In either case, this section has approximations where you can plug in the CCT to get the corresponding coordinates on the Planckian locus; then you just have to calculate the Euclidean distance of your point from that point using Pythagoras. I guess since you're already approximating by using McCamy's formula, this further approximation will be OK; if not, you can always do a full summation over the standard observer as shown further up in the article.

share|cite|improve this answer
Awesome! I guess the solution stared me in the face, right? Thanks for pointing it out. I already had the cubic spline function for calculating xy from Kelvin, so it is simply a matter of getting the "planckian" xy from this function and calculate the distance between the two coordinate pairs.//I used the illustration from uv space since I could not find one for xy space. I just learned that the isothermal lines are actually not normal to the locus for CIE 1931. I should probably switch to a newer color space some time in the future.//Again, thanks a lot! – morten Aug 22 '11 at 7:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.