{"uid":"cap_ZSvXbkfZ7V9hUes7Tzkv4","slug":"linear-algebra-transform-compose-79605fa3","name":"Linear Algebra Transform Compose","description":"Compose 2D or 3D rotate, scale and translate steps into one homogeneous matrix, optionally applied to a point.","url":"https://linear-algebra.x402tookit.com/transform-compose?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["steps"],"properties":{"dim":{"type":"integer","description":"2 (default, 3x3 matrix) or 3 (4x4 matrix)"},"point":{"type":"string","description":"Optional point to transform, JSON like [1,0] or 1,0,0 with dim entries"},"steps":{"type":"string","description":"JSON list applied in order, e.g. [{\"op\":\"rotate\",\"deg\":90},{\"op\":\"translate\",\"tx\":1,\"ty\":0}]; scale takes s or sx,sy,sz; 3D rotate needs axis"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"size":{"type":["null","number"]},"matrix":{"type":["array","null"],"items":{"type":"array","items":{"type":"number"}}},"source":{"type":["null","string"]},"inverse":{"type":["array","null"],"items":{"type":"array","items":{"type":"number"}}},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"orderNote":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"rigidMotion":{"type":["boolean","null"]},"stepsApplied":{"type":["array","null"],"items":{"type":"string"}},"transformedPoint":{"type":["array","null"],"items":{"type":"number"}},"preservesDistances":{"type":["boolean","null"]},"linearPartDeterminant":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7RjajZ_TFUfnEQAx9tdxi","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Composes a sequence of 2D or 3D rotate, scale, and translate operations into a single homogeneous transformation matrix, optionally applying it to a point.","exampleAgentPrompt":"Compose a 2D transformation that first rotates 45 degrees and then translates by (3, 2), and apply the result to the point (1, 0).","exampleUseCases":[{"title":"2D game object transform pipeline","prompt":"I need to combine a 2D scale by 2, then rotate 90 degrees, then translate by (5, 3) into one matrix — and also tell me where the point (1, 0) ends up after that full transformation."},{"title":"3D scene object placement","prompt":"Build a 3D transformation matrix that first rotates 30 degrees around the Z axis and then translates by (0, 0, 5), using a 4x4 homogeneous matrix, and apply it to the point (1, 0, 0)."},{"title":"Verify rigid motion of a rotation-translation chain","prompt":"Chain a 2D rotation of 60 degrees followed by a translation of (2, -1) into a single homogeneous matrix and tell me if the result is a rigid motion and what the determinant is."}],"resultDescription":"Returns a homogeneous transformation matrix (3x3 for 2D, 4x4 for 3D), its inverse, the determinant of the linear part, a flag indicating whether the transform is a rigid motion or preserves distances, an ordered list of steps applied, an optional transformed point if one was supplied, and a human-readable summary and order note.","failureModes":["Invalid or malformed steps JSON — returns error describing parsing failure","Unsupported operation type in steps (e.g. unknown 'op' value)","Dimension mismatch between steps and the specified dim parameter","Point array length does not match the specified dimension","Missing required 'steps' query parameter — returns 400-level error","3D rotate step missing required 'axis' field"],"whenToPreferThis":"Choose this endpoint when you need to compose a sequence of affine transformations (rotate, scale, translate) into a single homogeneous matrix for 2D or 3D use cases, especially in graphics pipelines, robotics kinematics, or geometric computation. Prefer it over manual matrix multiplication when you want the convenience of specifying human-readable operation steps rather than raw matrices, and when you also want the inverse matrix, rigidity analysis, and optional point transformation bundled in one call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:35:22.649Z","isFirstParty":false,"canonicalSlug":"linear-algebra-transform-compose-79605fa3"}