Description
Map rectangle corners to an ordered quadrilateral; no assumption that the transformed shape stays axis-aligned.
A planar affine transform combines a linear map and translation. This family stores [a,b,c,d,e,f], mapping [x,y] to [a×x+c×y+e,b×x+d×y+f]. Positions include translation; displacements use only the linear block, and normal covectors use its inverse transpose. Composition order changes the result.
Map rectangle corners to an ordered quadrilateral; no assumption that the transformed shape stays axis-aligned.
When to use this tool
Use this tool to map rectangle corners to an ordered quadrilateral; no assumption that the transformed shape stays axis-aligned.
How to use the tool and how it works
- Enter matrix, rectangle using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.corners. Interpret signs, units, ordering and null values using the rules below.
Form rectangle corners [minX,minY], [maxX,minY], [maxX,maxY], [minX,maxY] and apply the full affine map to each in that order.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| matrix | Six finite coefficients [a,b,c,d,e,f] in the mapping defined above. | Dense list of at most 128 finite numbers, subject to the stated integer/shape rules. |
| rectangle | Closed source rectangle [minX,minY,maxX,maxY] with ordered bounds. | Dense list of at most 128 finite numbers, subject to the stated integer/shape rules. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.corners | Four transformed rectangle corners in original corner traversal order. |
{
"input": {
"matrix": [
2,
0,
0,
3,
4,
5
],
"rectangle": [
0,
0,
1,
1
]
},
"output": {
"result": {
"corners": [
[
4,
5
],
[
6,
5
],
[
6,
8
],
[
4,
8
]
]
}
}
} Limitations and assumptions
- A rotation/shear generally produces a quadrilateral rather than an axis-aligned rectangle; no envelope is substituted.
- Matrices have six finite coefficients. Point/vector inputs have two components within ±1,000,000,000; rectangle bounds are likewise bounded and ordered. Coordinate units and axis directions are caller-defined. No conditioning threshold is inferred for inversion.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Check coefficient layout and application order when exchanging matrices. Use point, displacement or normal operations according to the quantity being transformed, and a separate conditioning analysis for numerically sensitive inverses.
References
Similar or alternative tools
- Affine Matrix About Anchor Transform
Move the linear transform’s origin to an explicit anchor, preserving existing translation.
- Affine Axis Basis Image
Expose origin image and linear basis-vector images separately, avoiding translation contamination of displacement axes.