Convert a point from math coordinates to screen coordinates, where the origin is top-left and row numbers increase downward.

Example

Convert a math point to the screen convention where rows increase downward.

highlighted = computed this step

Step 1 — Set up the screen grid

Use the screen convention: origin top-left, y down.

screen origin is top-left\text{screen origin is top-left}
Screen coordinate pixelPixel P is plotted at screen row 3 and column 2.01234501234P

Step 2 — Read the math point

Read the math point before changing convention.

Pmath=(2,1)P_{math}=( \hl{2} , \hl{1} )

Step 3 — Flip the y-coordinate

Flip y with row equals height minus one minus y.

row=511=3row= 5 - 1 - 1 = \hl{3}

Step 4 — Plot the screen cell

Plot the converted screen cell.

Pscreen=(3,2)P_{screen}=( \hl{3} , \hl{2} )
Screen coordinate pixelPixel P is plotted at screen row 3 and column 2.01234501234P
screen-coordinates-y-down Screen y-down coordinates are a computer graphics convention: columns increase rightward, and rows increase downward.