Calculates the linear offset of a point
from the start (0/0) of a rectangle.
This assumes that (0/0) is equivalent to offset 0.
Each step on the x-coordinate advances the resulting offset by 1.
Each step on the y-coordinate advances the resulting offset by width.
This function is only defined for the 1st quadrant,
i.e. both coordinates (x and y) of pos are positive.
Calculates the linear offset of a point from the start (0/0) of a rectangle.
This assumes that (0/0) is equivalent to offset 0. Each step on the x-coordinate advances the resulting offset by 1. Each step on the y-coordinate advances the resulting offset by width.
This function is only defined for the 1st quadrant, i.e. both coordinates (x and y) of pos are positive.