{"id":13393979,"url":"https://github.com/jlmakes/rematrix","last_synced_at":"2025-10-05T01:26:54.995Z","repository":{"id":48911584,"uuid":"92342752","full_name":"jlmakes/rematrix","owner":"jlmakes","description":"Matrix transformations made easy.","archived":false,"fork":false,"pushed_at":"2022-02-07T07:19:30.000Z","size":158,"stargazers_count":433,"open_issues_count":6,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-09-09T19:04:10.834Z","etag":null,"topics":["css","javascript","matrix","transform"],"latest_commit_sha":null,"homepage":"https://rematrix.now.sh/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlmakes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-24T22:43:13.000Z","updated_at":"2025-09-09T18:53:10.000Z","dependencies_parsed_at":"2022-09-05T17:00:49.111Z","dependency_job_id":null,"html_url":"https://github.com/jlmakes/rematrix","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/jlmakes/rematrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmakes%2Frematrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmakes%2Frematrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmakes%2Frematrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmakes%2Frematrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlmakes","download_url":"https://codeload.github.com/jlmakes/rematrix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlmakes%2Frematrix/sbom","scorecard":{"id":523507,"data":{"date":"2025-08-11","repo":{"name":"github.com/jlmakes/rematrix","commit":"c49c6b94a78d9b0e439bacc36cfbaad51230961f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T03:41:46.596Z","repository_id":48911584,"created_at":"2025-08-20T03:41:46.596Z","updated_at":"2025-08-20T03:41:46.596Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278399621,"owners_count":25980330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","javascript","matrix","transform"],"created_at":"2024-07-30T17:01:04.408Z","updated_at":"2025-10-05T01:26:54.951Z","avatar_url":"https://github.com/jlmakes.png","language":"JavaScript","readme":"\u003c!-- \u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rematrix.now.sh\" title=\"Visit Rematrix demo\"\u003e\n\t  \u003cimg src=\"https://jlmakes.com/logos/svg/rematrix.svg\" width=\"120px\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://rematrix.now.sh\" title=\"Visit Rematrix demo\"\u003e\n\t  \u003cimg src=\"https://jlmakes.com/logos/svg/rematrix-logotype.svg\" alt=\"Rematrix\" width=\"130px\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n --\u003e\n \n# Rematrix\n\nMatrix transformations made easy.\n\n\u003cp\u003e\n\t\u003ca href=\"https://travis-ci.org/jlmakes/rematrix\"\u003e\u003cimg src=\"https://img.shields.io/travis/jlmakes/rematrix?color=gray\u0026style=flat\" alt=\"Build status\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://coveralls.io/github/jlmakes/rematrix\"\u003e\u003cimg src=\"https://img.shields.io/coveralls/jlmakes/rematrix?color=gray\u0026style=flat\" alt=\"Coverage\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://www.npmjs.com/package/rematrix\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/rematrix?color=gray\u0026style=flat\" alt=\"Downloads\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://www.npmjs.com/package/rematrix\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/rematrix?color=gray\u0026style=flat\" alt=\"Version\"\u003e\u003c/a\u003e\n    \t\u003ca href=\"https://github.com/jlmakes/rematrix/blob/master/src/index.js\"\u003e\u003cimg src=\"https://img.shields.io/badge/min+gzip-1.3_kB-gray\" alt=\"1.3 kB min+gzip\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/jlmakes/rematrix/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-gray\" alt=\"MIT license\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n# Introduction\n\nImagine a HTML element that may have a CSS transform applied. If we want to add 45° of Z-rotation, we have no way to handle this safely in CSS—we’d just risk overwriting an existing transform. So we decide to use JavaScript, and check the current transform...\n\n`getComputedStyle(element)` returns the computed styles, and inspecting the `transform` property shows:\n\n```js\n'matrix3d(0.707107, 0.707107, 0, 0, -0.707107, 0.707107, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'\n```\n\nIt’s here we discover that browsers actually use [transformation matrices](https://en.wikipedia.org/wiki/Transformation_matrix) under the hood to describe rotation, translation, scale and shear. This means if we wish to manage CSS transforms with JavaScript (without overwriting existing transformations), we’re stuck working with matrices.\n\n**Rematrix** is an easy way to create and combine matrix transformations that work seamlessly with CSS.\n\n\u003cbr\u003e\n\n# Installation\n\n## Browser\n\nA simple and fast way to get started is to include this script on your page:\n\n```html\n\u003cscript src=\"https://unpkg.com/rematrix\"\u003e\u003c/script\u003e\n```\n\n\u003e If you use this method in production, be sure to specify a fixed version number, and use the minified distribution; e.g: `https://unpkg.com/rematrix@0.7.2/dist/rematrix.min.js`. This improves performance, but also prevents library changes from impacting your project.\n\nThis will create the global variable `Rematrix`.\n\n## Module\n\n```bash\nnpm install rematrix\n```\n\n#### CommonJS\n\n```js\nconst Rematrix = require('rematrix')\n```\n\n#### ES2015\n\n```js\nimport * as Rematrix from 'rematrix'\n```\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n# Guide\n\n## Creating Transforms\n\nMost API methods look a lot like CSS, so for example, in CSS if we would write `transform: rotateZ(45deg)`, we can create the same transformation in JavaScript using Rematrix like this:\n\n```js\nRematrix.rotateZ(45)\n```\n\nThis returns a 45° rotation along the Z-axis, represented as an array of 16 values:\n\n```js\n[0.707107, 0.707107, 0, 0, -0.707107, 0.707107, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]\n```\n\nThese 16 values represent our **transformation matrix** in [column-major order](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d).\n\n\u003cbr\u003e\n\n## Combining Transforms (Using Multiplication)\n\nWhere Rematrix really outshines CSS, is the ability to combine transforms — using **matrix multiplication**. We’ll recreate the same 45° rotation along the Z-axis, but using separate matrices this time:\n\n```js\nlet r1 = Rematrix.rotateZ(20)\nlet r2 = Rematrix.rotateZ(25)\n\nlet product = Rematrix.multiply(r1, r2)\n```\n\nHere `product` describes the same array of 16 values (seen above):\n\n```js\n[0.707107, 0.707107, 0, 0, -0.707107, 0.707107, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]\n```\n\n#### Better Multiplication (Using Reduce)\n\nThere’s a good chance we’ll need to multiply quite a few matrices together, so its helpful to store them in an array in order to use `Array.prototype.reduce` to multiply them all in one line:\n\n```js\nlet r1 = Rematrix.rotateZ(20)\nlet r2 = Rematrix.rotateZ(65)\nlet r3 = Rematrix.rotateZ(-40)\n\nlet product = [r1, r2, r3].reduce(Rematrix.multiply)\n```\n\n\u003e Order is important. For example, rotating 45° along the Z-axis, followed by translating 500 pixels along the Y-axis... is not the same as translating 500 pixels along the Y-axis, followed by rotating 45° along on the Z-axis.\n\n## Preserving Transforms\n\nBefore applying any of our transforms, we should capture the existing transform of our element using `Rematrix.fromString()`, e.g:\n\n```js\nlet element = document.querySelector('#example')\nlet style = getComputedStyle(element).transform\n\nlet transform = Rematrix.fromString(style)\n\nlet r1 = Rematrix.rotateZ(20)\nlet r2 = Rematrix.rotateZ(65)\nlet r3 = Rematrix.rotateZ(-40)\n\nlet product = [transform, r1, r2, r3].reduce(Rematrix.multiply)\n```\n\nBy passing the computed transform styles to `Rematrix.fromString()`, we create a matrix of the existing transform. We can now factor this into our multiplication.\n\n\u003e The existing transformation has been _deliberately_ placed at the start of the array to ensure the computed transform is the foundation for the succeeding transformations.\n\n## Applying Transforms\n\nWe can turn our matrix into valid CSS using `Rematrix.toString()`, which we can apply to our element’s style, e.g:\n\n```js\nelement.style.transform = Rematrix.toString(product)\n```\n\n#### _And that concludes this introduction to Rematrix. Please explore the finished [Live Demo on JSFiddle](https://jsfiddle.net/ufrLymvo/)._\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n\u003ca name=\"Rematrix\"\u003e\u003c/a\u003e\n\n# API Reference\n\n* [format(source)](#Rematrix.format)\n* [fromString(source)](#Rematrix.fromString)\n* [identity()](#Rematrix.identity)\n* [inverse(source)](#Rematrix.inverse)\n* [multiply(matrixA, matrixB)](#Rematrix.multiply)\n* [perspective(distance)](#Rematrix.perspective)\n* [rotate(angle)](#Rematrix.rotate)\n* [rotateX(angle)](#Rematrix.rotateX)\n* [rotateY(angle)](#Rematrix.rotateY)\n* [rotateZ(angle)](#Rematrix.rotateZ)\n* [scale(scalar, [scalarY])](#Rematrix.scale)\n* [scaleX(scalar)](#Rematrix.scaleX)\n* [scaleY(scalar)](#Rematrix.scaleY)\n* [scaleZ(scalar)](#Rematrix.scaleZ)\n* [skew(angleX, [angleY])](#Rematrix.skew)\n* [skewX(angle)](#Rematrix.skewX)\n* [skewY(angle)](#Rematrix.skewY)\n* [toString(source)](#Rematrix.toString)\n* [translate(distanceX, [distanceY])](#Rematrix.translate)\n* [translate3d(distanceX, distanceY, distanceZ)](#Rematrix.translate3d)\n* [translateX(distance)](#Rematrix.translateX)\n* [translateY(distance)](#Rematrix.translateY)\n* [translateZ(distance)](#Rematrix.translateZ)\n\n\n\u003ca name=\"Rematrix.format\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### format(source) ⇒ `number[]`\n\nTransformation matrices in the browser come in two flavors:\n\n* `matrix` using 6 values (short)\n* `matrix3d` using 16 values (long)\n\nThis utility follows this [conversion guide](https://goo.gl/EJlUQ1)\nto expand short form matrices to their equivalent long form.\n\n| Param  | Description                      |\n| ------ | -------------------------------- |\n| source | A `number[]` with length 6 or 16 |\n\n\n\u003ca name=\"Rematrix.fromString\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### fromString(source) ⇒ `number[]`\n\nConverts a CSS Transform to array.\n\n| Param  | Description                                                    |\n| ------ | -------------------------------------------------------------- |\n| source | A `string` containing a `matrix` or `matrix3d` property value. |\n\n\n\u003ca name=\"Rematrix.identity\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### identity() ⇒ `number[]`\n\nReturns a matrix representing no transformation. The product of any matrix\nmultiplied by the identity matrix will be the original matrix.\n\n\u003e **Tip:** Similar to how `5 * 1 === 5`, where `1` is the identity.\n\n\u003ca name=\"Rematrix.inverse\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### inverse(source) ⇒ `number[]`\n\nReturns a matrix representing the inverse transformation of the source\nmatrix. The product of any matrix multiplied by its inverse will be the\nidentity matrix.\n\n\u003e **Tip:** Similar to how `5 * (1/5) === 1`, where `1/5` is the inverse.\n\n| Param  | Description                      |\n| ------ | -------------------------------- |\n| source | A `number[]` with length 6 or 16 |\n\n\n\u003ca name=\"Rematrix.multiply\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### multiply(matrixA, matrixB) ⇒ `number[]`\n\nReturns a matrix representing the combined transformations\nof both arguments.\n\n\u003e **Note:** Order is important. For example, rotating 45° along the Z-axis,\n\u003e followed by translating 500 pixels along the Y-axis...\n\u003e Is not the same as translating 500 pixels along the Y-axis,\n\u003e followed by rotating 45° along on the Z-axis.\n\n| Param   | Description                      |\n| ------- | -------------------------------- |\n| matrixA | A `number[]` with length 6 or 16 |\n| matrixB | A `number[]` with length 6 or 16 |\n\n\n\u003ca name=\"Rematrix.perspective\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### perspective(distance) ⇒ `number[]`\n\nReturns a matrix representing perspective.\n\n| Param    | Description                    |\n| -------- | ------------------------------ |\n| distance | A `number` measured in pixels. |\n\n\n\u003ca name=\"Rematrix.rotate\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### rotate(angle) ⇒ `number[]`\n\nReturns a matrix representing Z-axis rotation.\n\n\u003e **Tip:** This is just an alias for `Rematrix.rotateZ` for parity with CSS\n\n| Param | Description                     |\n| ----- | ------------------------------- |\n| angle | A `number` measured in degrees. |\n\n\n\u003ca name=\"Rematrix.rotateX\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### rotateX(angle) ⇒ `number[]`\n\nReturns a matrix representing X-axis rotation.\n\n| Param | Description                     |\n| ----- | ------------------------------- |\n| angle | A `number` measured in degrees. |\n\n\n\u003ca name=\"Rematrix.rotateY\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### rotateY(angle) ⇒ `number[]`\n\nReturns a matrix representing Y-axis rotation.\n\n| Param | Description                     |\n| ----- | ------------------------------- |\n| angle | A `number` measured in degrees. |\n\n\n\u003ca name=\"Rematrix.rotateZ\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### rotateZ(angle) ⇒ `number[]`\n\nReturns a matrix representing Z-axis rotation.\n\n| Param | Description                     |\n| ----- | ------------------------------- |\n| angle | A `number` measured in degrees. |\n\n\n\u003ca name=\"Rematrix.scale\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### scale(scalar, [scalarY]) ⇒ `number[]`\n\nReturns a matrix representing 2D scaling. The first argument\nis used for both X and Y-axis scaling, unless an optional\nsecond argument is provided to explicitly define Y-axis scaling.\n\n| Param     | Description                               |\n| --------- | ----------------------------------------- |\n| scalar    | A `number` decimal multiplier.            |\n| [scalarY] | A `number` decimal multiplier. (Optional) |\n\n\n\u003ca name=\"Rematrix.scaleX\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### scaleX(scalar) ⇒ `number[]`\n\nReturns a matrix representing X-axis scaling.\n\n| Param  | Description                    |\n| ------ | ------------------------------ |\n| scalar | A `number` decimal multiplier. |\n\n\n\u003ca name=\"Rematrix.scaleY\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### scaleY(scalar) ⇒ `number[]`\n\nReturns a matrix representing Y-axis scaling.\n\n| Param  | Description                    |\n| ------ | ------------------------------ |\n| scalar | A `number` decimal multiplier. |\n\n\n\u003ca name=\"Rematrix.scaleZ\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### scaleZ(scalar) ⇒ `number[]`\n\nReturns a matrix representing Z-axis scaling.\n\n| Param  | Description                    |\n| ------ | ------------------------------ |\n| scalar | A `number` decimal multiplier. |\n\n\n\u003ca name=\"Rematrix.skew\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### skew(angleX, [angleY]) ⇒ `number[]`\n\nReturns a matrix representing shear. The first argument\ndefines X-axis shearing, and an optional second argument\ndefines Y-axis shearing.\n\n| Param    | Description                                |\n| -------- | ------------------------------------------ |\n| angleX   | A `number` measured in degrees.            |\n| [angleY] | A `number` measured in degrees. (Optional) |\n\n\n\u003ca name=\"Rematrix.skewX\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### skewX(angle) ⇒ `number[]`\n\nReturns a matrix representing X-axis shear.\n\n| Param | Description                     |\n| ----- | ------------------------------- |\n| angle | A `number` measured in degrees. |\n\n\n\u003ca name=\"Rematrix.skewY\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### skewY(angle) ⇒ `number[]`\n\nReturns a matrix representing Y-axis shear.\n\n| Param | Description                     |\n| ----- | ------------------------------- |\n| angle | A `number` measured in degrees. |\n\n\n\u003ca name=\"Rematrix.toString\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### toString(source) ⇒ `string`\n\nReturns a CSS Transform property value equivalent to the source matrix.\n\n| Param  | Description                      |\n| ------ | -------------------------------- |\n| source | A `number[]` with length 6 or 16 |\n\n\n\u003ca name=\"Rematrix.translate\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### translate(distanceX, [distanceY]) ⇒ `number[]`\n\nReturns a matrix representing 2D translation. The first\nargument defines X-axis translation, and an optional second\nargument defines Y-axis translation.\n\n| Param       | Description                               |\n| ----------- | ----------------------------------------- |\n| distanceX   | A `number` measured in pixels.            |\n| [distanceY] | A `number` measured in pixels. (Optional) |\n\n\n\u003ca name=\"Rematrix.translate3d\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### translate3d(distanceX, distanceY, distanceZ) ⇒ `number[]`\n\nReturns a matrix representing 3D translation. The first\nargument defines X-axis translation, the second argument defines Y-axis\ntranslation, and the third argument defines Z-axis translation.\n\n| Param     | Description                    |\n| ----------| ------------------------------ |\n| distanceX | A `number` measured in pixels. |\n| distanceY | A `number` measured in pixels. |\n| distanceZ | A `number` measured in pixels. |\n\n\n\u003ca name=\"Rematrix.translateX\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### translateX(distance) ⇒ `number[]`\n\nReturns a matrix representing X-axis translation.\n\n| Param    | Description                    |\n| -------- | ------------------------------ |\n| distance | A `number` measured in pixels. |\n\n\n\u003ca name=\"Rematrix.translateY\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### translateY(distance) ⇒ `number[]`\n\nReturns a matrix representing Y-axis translation.\n\n| Param    | Description                    |\n| -------- | ------------------------------ |\n| distance | A `number` measured in pixels. |\n\n\n\u003ca name=\"Rematrix.translateZ\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n### translateZ(distance) ⇒ `number[]`\n\nReturns a matrix representing Z-axis translation.\n\n| Param    | Description                    |\n| -------- | ------------------------------ |\n| distance | A `number` measured in pixels. |\n\n\u003cbr\u003e\n\n\u003cbr\u003e\n\n---\n\nCopyright 2021 Julian Lloyd.\n\u003cbr\u003e\nOpen source under the [MIT License](https://github.com/jlmakes/rematrix/blob/master/LICENSE).\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlmakes%2Frematrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlmakes%2Frematrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlmakes%2Frematrix/lists"}