Length in CM = LenghtPixels * 2.54 / DPI
I think you can get the DPI of every display using WMI, the value you're searching for is in the class Win32_DisplayConfiguration, under the field LogPixe.
Check this link about using WMI to retrieve data: LINK