Skip to content

Instantly share code, notes, and snippets.

@shaunhess
Created April 1, 2014 01:26
Show Gist options
  • Select an option

  • Save shaunhess/9906000 to your computer and use it in GitHub Desktop.

Select an option

Save shaunhess/9906000 to your computer and use it in GitHub Desktop.
Monitor Notes
################################################################################
# Calculate Pixels Per Inch
################################################################################
# Calculate w/ the Horizontal x Vertical resolution, Horizontal & Vertical size
################################################################################
Horizontal_Resolution = 2560
Vertical_Resolution = 1440
Horizontal_Size_MM = 597.89
Vertical_Size_MM = 336.31
# Convert Millimeter to Inches
Horizontal_Size_Inches = Horizontal_Size_MM / 25.4
Vertical_Size_Inches = Vertical_Size_MM / 25.4
# These should typically match
Horizontal_Pixels_Per_Inch = Horizontal_Resolution / Horizontal_Size_Inches
Vertical_Pixels_Per_Inch = Vertical_Resolution / Vertical_Size_Inches
# Calculate w/ pitch info
################################################################################
Horizontal_Pitch_MM = 0.233
Vertical_Pitch_MM = 0.233
# Convert Millimeter to Inches
Horizontal_Pitch_Inches = Horizontal_Pitch_MM / 25.4
Vertical_Pitch_Inches = Vertical_Pitch_MM / 25.4
Horizontal_Pixels_Per_Inch = 1 / Horizontal_Pitch_Inches
Vertical_Pixels_Per_Inch = 1 / Vertical_Pitch_Inches
# Calculate w/ resolution and diagonal size
################################################################################
Horizontal_Resolution = 2560
Vertical_Resolution = 1440
Diagonal_Resolution = (Horizontal_Resolution^2 + Vertical_Resolution^2)^0.5
Diagonal_Size_Inches = 27
Pixels_Per_Inch = Diagonal_Resolution / Diagonal_Size_Inches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment