Friday, July 9, 2010

Intervals, Interval Boundaries and Pixels

Anyone working as a computer programmer has at some point had to precisely distinguish between intervals and interval boundaries.

Intervals are delimited by interval boundaries.  For instance, 1-2 denotes a single interval.  In this case the interval is delimited by 2 interval boundaries (1 and 2).

There are always 1 more interval boundaries than there are intervals (since intervals are closed).

A similar relationship can be seen in languages that index arrays/collections from 0.  The total number of elements (or count) in an array is 1 greater than the number of indices.

Having recently worked on drawing lines on 2D surfaces with DirectX I’m beginning to think of pixels as intervals and vertices as interval boundaries.

No comments :

Post a Comment