xyY to XYZ

Given an $(x, y, Y)$ color whose $Y$ component is in the nominal range [0.0, 1.0]:

$$X = {{xY} \over {y}}$$ $$Y = Y$$ $$Z = {{(1-x-y)Y} \over {y}}$$

Implementation Notes:

  1. Watch out for the case where $y=0$. In that case, you may want to set $X=Y=Z=0$.
  2. The output $(X,Y,Z)$ values are in the same nominal range as the input $Y$ (typically, [0.0, 1.0], [0.0, 100.0] or physical units).