Showing posts with label Math. Show all posts
Showing posts with label Math. Show all posts

Wednesday, June 24, 2009

How to calculate dot pitch

Dot Pitch is the measure of the distance between each adjoining pixel on a color computer monitor (including LCD monitors), expressed in millimeters (mm). The lower the dot pitch the sharper the displayed image. Typically color monitors come with a dot pitch of 0.3 mm or lower.

Dot Pitch is related to resolution because resolution is a measure of the number of pixels horizontally and vertically. Given this relationship we can calculate the dot pitch of any monitor if we know the horizontal resolution, vertical resolution, and the diagonal distance. Technically, if we new vertical and horizontal measure in inches for example, we could do the same thing and get a more accurate measure of dot pitch. However, all marketing and technical specs use the horizontal dot pitch.

With a little math and conversion of units you can easily calculate the dot pitch yourself.

Let’s take the example of a monitor that is 1280 pixels horizontally by 1024 pixels vertically and has a viewable display (make sure you use the viewable measurement, not the advertised one since they differ slightly sometimes) of 20 inches.

Below is visual of the information we know. You’ll notice that we have a difference in the units here. We have pixels and inches. We do need to do some calculations to figure out what the 20 inches is in pixels.

 monitor

To calculate the diagonal in pixels we need to go back to our grade school math class. We can think of the problem as math problem where we have a right triangle and are solving for the hypotenuse (the diagonal). Below is a visual of the problem.

triangle

We need to solve for d. To do that we use the formula

d*d = x*x + y*y

We need to solve for d which means

d = square root (x*x + y*y)

For our example:  d = square root (1280 * 1280 + 1024 * 1024)

d = 1639.2 pixels

Now we know the diagonal in inches and pixels. This means we can calculate the ratio between them which is known as pixels per inch (ppi). This can be calculate very simply by dividing pixels by inches.

ppi = pixels / inches

In our example: ppi = 1639.2 / 20 = 81.96 pixels per inch.

This is a measure of dot pitch, but it is not really what marketing and technical specs will use. They use millimeters since they are smaller units of measure and more appropriate for small things like pixels.

To make our calculation compatible with marketing and technical specs we need to convert our answer to pixels per millimeter (dot pitch). It is a known conversion factor that 1 in is equal to 25.4 mm. Here is the formula to convert our answer to pixels to millimeter.

dot pitch = 25.4 / ppi

For our example: dot pitch = 25.4 / 81.96 = .31 pixels per mm (which is commonly known as dot pitch)

If you don’t want to do the math yourself, you can just use the JavaScript function below.

<script>
function calcDotPitch(hPixels, vPixels, diagonal)
{
var d = Math.sqrt(hPixels * hPixels + vPixels * vPixels);
var ppi = d/diagonal;
var dotPitch = 25.4 / ppi;
return dotPitch;
}
alert(calcDotPitch(1280, 1024, 20));
</script>