The color difference, or ΔE, between a sample color L_{2}a_{2}b_{2} and a reference color L_{1}a_{1}b_{1} is:

where

**Implementation Notes:**

- The angles supplied to the
*sin*and*cos*functions are shown in degrees. Most math libraries expect radians, so don't forget to convert. - The inverse tangent is also expressed in degrees. In most math libraries, the inverse tangent returns radians, so don't forget to convert.
- In computing hue angles, be careful with the inverse tangent since
*a*could be zero. Instead, use special math functions to do this. In both the Standard C library and Java, this function is called**atan2**. In Microsoft Excel, it is called**ATAN2**. These special functions will compute the proper inverse tangents without needing to worry about "divide by zero" conditions.