Here you can find the source of pixelsToCm(float pixels)
public static float pixelsToCm(float pixels)
//package com.java2s; //License from project: Open Source License public class Main { private static float DPI; public static float pixelsToCm(float pixels) { return (pixels / DPI) * (1 / 0.393700787f); }/* www.ja v a 2s . c om*/ }