scReen

the math behind scReen

every number in scReen is calculated on the fly from two inputs: a diagonal size and a resolution. no lookup tables, no hardcoded dimensions. here's how it works.

physical dimensions

when you add a display, you provide a diagonal (say, 13.3 inches) and a resolution (say, 2560×1600). the physical width and height aren't stored anywhere — they're derived using the pythagorean theorem.

the pixel counts form a right triangle where the diagonal pixel count is the hypotenuse. knowing that ratio and the physical diagonal is enough to recover both dimensions:

diagonal_px = sqrt(resW² + resH²)
width_in   = diagonal_in × resW / diagonal_px
height_in  = diagonal_in × resH / diagonal_px

for a 13.3-inch 2560×1600 display, the diagonal pixel count is ~3017 px, giving a physical size of 11.26 × 7.04 inches. scReen uses these numbers to draw each rectangle at its actual relative scale.

pixel density

PPI (pixels per inch) measures how tightly packed the pixels are. the same pythagorean logic applies, just solved in the other direction:

PPI = sqrt(resW² + resH²) / diagonal_in

the numerator is the total pixel count along the diagonal. divide by the physical diagonal length and you get how many pixels fit in each inch. a higher PPI means sharper images and crisper text.

note that PPI measures physical density, not rendering density. a display set to 2× scaling has a higher PPI than a 1× display but renders the same logical pixel count to your app.

density tiers

scReen color-codes displays in the spec table using three thresholds:

high: above 220 PPI

modern phones, retina laptops, high-DPI monitors. individual pixels are not distinguishable at typical use distance.

mid: 110 to 220 PPI

most monitors and standard laptops. sharp at arm's length but below retina for close work.

low: below 110 PPI

large TVs and older displays. lower density is expected and acceptable at greater viewing distances.

these thresholds are practical buckets for comparison within scReen, not universal standards.

retina and angular resolution

the human eye can resolve about 1 arcminute of visual angle — that's 1/60th of a degree. below that threshold, features become indistinguishable. apple based the term “retina display” on this limit: the pixels are small enough that they can't be individually perceived at the device's normal use distance.

the key phrase is “normal use distance.” a phone is held much closer than a TV, so it needs a much higher PPI to meet the same perceptual threshold. the minimum PPI needed to stay below 1 arcminute at a given distance d (in inches):

min_PPI = 1 / (2 × d × tan(0.5 arcmin))
         ≈ 3438 / d

at typical viewing distances for each device type:

devicetypical distancemin PPI
phone12 in286
laptop20 in172
monitor28 in123
TV96 in36

a 400 PPI phone and a 40 PPI TV can both qualify as retina for their context. what matters is whether individual pixels are distinguishable at the actual viewing distance, not the raw number. this is also why scReen's density tiers use fixed thresholds. they're optimized for comparison, not for declaring any single display “good” or “bad.”