Geometry
Compose 2D affine transform API
Compose translate/rotate/scale/shear operations into a single 3x3 homogeneous matrix and apply it to points, in listed order. Answers 'what is the combined transform matrix?', 'where do these points map to?'.
Price$0.03per request
MethodPOST
Route/v1/geometry/affine-2d
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
affinetransformmatrixtranslaterotatescaleshearhomogeneous2d
API URL
Integration docshttps://x402.hexl.dev/v1/geometry/affine-2dExample request
{
"operations": [
{
"type": "translate",
"tx": 1,
"ty": 0
},
{
"type": "rotate",
"angleDeg": 90
}
],
"points": [
[
0,
0
]
]
}Example response
{
"matrix": [
[
0,
-1,
0
],
[
1,
0,
1
],
[
0,
0,
1
]
],
"transformedPoints": [
[
0,
1
]
]
}Input schema
{
"type": "object",
"required": [
"operations"
],
"properties": {
"operations": {
"type": "array",
"items": {
"type": "object"
},
"examples": [
[
{
"type": "translate",
"tx": 1,
"ty": 0
},
{
"type": "rotate",
"angleDeg": 90
}
]
]
},
"points": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number"
}
},
"examples": [
[
[
0,
0
]
]
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}