# math on widths doesn't add up

hh hh at hyperhh.de
Sat Jun 15 04:00:36 EDT 2019

```[Sorry, confused notation. The last part of my previous post should read:]

This is certainly in general a clear method for counting/ identifying
pixels. For example:

The rect (x1,y1,x2,y2) with x1<x2 and y1<y2 has (x2-x1)*(y2-y1) pixels.

The topleft pixel (x1,y1,x1+1,y1+1) = LC-point (x1,y1) is
math-located at (x1+0.5,y1+0.5) and
the bottomright pixel (x2-1,y2-1,x2,y2) = LC-point (x2-1,y2-1) is
math-located at (x2-0.5,y2-0.5).

The topleft of the first pixel is the math-point (x1,y1),
the bottomright of the last pixel is the math-point (x2,y2).

> I wrote:
> "Use center pixel coordinates" does probably mean you use the math-loc
> of a pixel as model? For example (always assume a linewidth of 1):
>
> LC point (0,0) = rect (0,0,1,1) = first pixel has a math-loc of (0.5,0.5).
> One imagines the pixel pinned up at its math-loc/center.
> [I use the notation "math-loc" to avoid confusion with the rounded LC-loc.]
>
> This is certainly in general a clear method for counting/ identifying
> pixels. For example:
>
> The rect (x1,y1,x2,y2) with x1<x2 and y1<y2 has (x2-x1)*(y2-y1) pixels.
>
> The topleft pixel (x1,x2,x1+1,x2+1) = LC-point (x1,x2) is
> math-located at (x1+0.5,x2+0.5) and
> the bottomright pixel (x1-1,y2-1,x2,y2) = LC-point (x1-1,x2-1) is
> math-located at (x2-0.5,y2-0.5).
>
> The topleft of the first pixel is the math-point (x1,y1),
> the bottomright of the last pixel is the math-point (x2,y2).

```