sqrt((width^2)+(height^2))/diagonal length
This OP ^^Diagonal number of pixels: use Pythagoras sqrt((width^2)+(height^2))/diagonal length
fixed that for you.
Damn, I hoped no one would notice that Was too busy adding the ACD calc
Number of Pixels/Number of Inches
Pretty straight forward maths.
Diagonal number of pixels: use Pythagoras:
Code:sqrt((width^2)+(height^2))/diagonal length
The ACD 24": (1920^2 + 1200^2)/24 = 94.3 dpi
var width = 1920;
var height = 1080;
var diagonal_inches = 24;
// result:
Math.sqrt((Math.pow(width,2)+Math.pow(height,2)))/diagonal_inches