Function getPhysicalDevicePixelSizeInMm

Calculates the approximate size of a single physical device pixel in millimeters.

This calculation is based on the standard CSS definition of a reference pixel (1/96th of an inch) and the current devicePixelRatio of the window.

It reflects the effective size of the smallest addressable pixel by the browser, considering screen density and browser/OS zoom levels.

  • Returns number

    The approximate size of a physical pixel in millimeters. Returns NaN if window or window.devicePixelRatio is not available (e.g., in a Node.js environment).