Input variables
| Variable | Meaning | Unit |
|---|---|---|
| st | Stitches in swatch | stitches |
| rows | Rows in swatch | rows |
| sw | Measured swatch width | cm |
| sh | Measured swatch height | cm |
| w | Target width | cm |
| h | Target height | cm |
| repeat | Stitch repeat | stitches |
Equations
Unrounded target stitches · stitches
raw = st/sw*w
Stitches rounded to repeat · stitches
cast = ceil(raw/repeat)*repeat
Target rows · rows
rowcount = round(rows/sh*h)
Width at rounded stitch count · cm
actual = cast/(st/sw)
Notation
PI means π. ** means a power, sqrt means square root, and abs gives the absolute value. Trigonometric functions use radians. min and max select the smallest or largest argument.
ceil rounds upward, floor rounds downward, and round rounds to the nearest integer with halves toward positive infinity. roundup(value, step) rounds upward to the next multiple of the step; a zero step leaves the value unchanged.
Assumptions
- Measure a washed and dried swatch in the intended stitch pattern.
- Repeat rounding changes the achieved width; the calculator shows that effect.
- Selvage stitches are not automatically added.
- Shaping and ease require a garment pattern beyond a rectangular gauge calculation.
Precision and verification
The tool uses ordinary double-precision numeric arithmetic. Output is displayed to at most four decimal places; measurement precision is usually much lower. Check the worked examples, your project’s specifications, and a real sample before committing material.