{"_id":"@3dlyra/matrix4","name":"@3dlyra/matrix4","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@3dlyra/matrix4","version":"1.0.0","description":"This library is the 4x4 matrix part of the 3DLyra's math library.","main":"matrix4.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/3dlyra/matrix.git"},"keywords":["3dlyra","matrix","math"],"author":{"name":"3DLyra"},"collaborators":["3DLyra <contact@3dlyra.com>"],"license":"MIT","bugs":{"url":"https://github.com/3dlyra/matrix4/issues","email":"contact@3dlyra.com"},"homepage":"https://www.3dlyra.com","funding":{"type":"buymeacoffee","url":"https://www.buymeacoffee.com/3dlyra"},"types":"./matrix4.d.ts","gitHead":"62c35b4d42aa1daf9727ab5477332431b05fec1c","_id":"@3dlyra/matrix4@1.0.0","_nodeVersion":"19.5.0","_npmVersion":"9.4.0","dist":{"integrity":"sha512-AWKg/itnOerdnhXSeSmAWvPuY2MGyefu/hbMCSh8nyG1rNAZWCKP7ccGkyNY9TCwRq6JxWW+tROCdaTlSh9ajg==","shasum":"423c3e4f4a0a9629ff6d5d0e9c1ab51689eb93fe","tarball":"https://registry.npmjs.org/@3dlyra/matrix4/-/matrix4-1.0.0.tgz","fileCount":4,"unpackedSize":6768,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDxS8AVFwFIftmWoOYeSGpb16DlceWl+HISiY3M8vLp9AiAONmQsLYA5AbvqM0B6Oqx1ipldHEAmqECfND2QYr583A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj54n7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDZg//eJLVsiSEn0ph4W5ZTyK7o0zrEbbznj2UJmzRanLK8RqYalD9\r\nxls9wlZl8+BePoVTqJxLTYnwaIikfzfyDh5wUCKG7X+4ytBea2Wz6gxr1e/q\r\nVj1RgES5+yQ0OQYBolzjdUxgB7wRU5qtYhOX7Ju+A1wU5dnVFfNnRsecqcnZ\r\nxOAdbnDw+b4f+wsphT7XiwEQS4BxF0WQZ1QN3c8tSNazHL+pIimLOLARNn5D\r\nER9P0Jww2si6uPLk+JjSs40fdtWt8kVWdf/srJJy9u4tfeNl3elB2/DG6+6C\r\nkk0pbwKOA/xQrppPl93zEOaSqtvFa2GQIXNoQqh043gl4zpg8PAu0AZyNlPl\r\nGZmxu0RT6v0KUmTOfgjnwyb6K6jazQ8bgQl5RFi9ygFWwF/fw9GV7N05r/9s\r\narXbXej/qhFt25uAIUQdQ8YUfch/muFOgUVIiVZJ06/LstHnxIp7VquRHTBq\r\nQw/roDsXr46yCULdvqyQzOwHWbZKqLn0y9jXIj2AYKBP8h9OI6De+IkFNUb7\r\nMhmWYKQDHR+tJFJbRNjrFkc7pNnz4jimz/ncOqNtTDdreK4jJ8k4gIYGiAPf\r\nwVxrU4vEfgs4nfecBroF2EtY7pKwLYE1bHAk4JO4IZZTa8yfRP7YW8pBeDHi\r\nCW7bjj7eNELvcXCd2TmEmTkgyok638ME5Oo=\r\n=sbFd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"3dlyra","email":"3dlyra.com@gmail.com"},"directories":{},"maintainers":[{"name":"3dlyra","email":"3dlyra.com@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/matrix4_1.0.0_1676118522826_0.05552678928200683"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-11T12:28:42.826Z","1.0.0":"2023-02-11T12:28:42.997Z","modified":"2023-02-11T12:28:43.236Z"},"maintainers":[{"name":"3dlyra","email":"3dlyra.com@gmail.com"}],"description":"This library is the 4x4 matrix part of the 3DLyra's math library.","homepage":"https://www.3dlyra.com","keywords":["3dlyra","matrix","math"],"repository":{"type":"git","url":"git+https://github.com/3dlyra/matrix.git"},"author":{"name":"3DLyra"},"bugs":{"url":"https://github.com/3dlyra/matrix4/issues","email":"contact@3dlyra.com"},"license":"MIT","readme":"# Matrix4\r\nThis library is the 4x4 matrix part of the 3DLyra's math library.\r\n### Installation\r\n```\r\nnpm i @3dlyra/matrix4\r\n```\r\n### Example\r\n```JavaScript\r\nimport * as Matrix4 from \"@3dlyra/matrix4\"\r\n\r\n{\r\n  const m = Matrix4.create() // (a.k.a identity) Float32Array[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]\r\n  const position = Matrix4.translate( m, [ 1, 2, 3 ] )\r\n  console.log( Matrix4.applyToVector3( position, [ 4, 5, 6 ] ) ) // [ 5, 7, 9 ]\r\n}\r\n\r\n{\r\n  const m = Matrix4.create()\r\n  const rotation = Matrix4.rotateAxis( m, [ 1, 0, 0 ], Math.PI / 2 ) // rotate by x-axis\r\n  console.log( Matrix4.applyToVector3( rotation, [ 2, 4, 8 ] ) ) // [ 2, -8, 4 ]\r\n}\r\n\r\n{\r\n  const m = Matrix4.create()\r\n  const scale = Matrix4.scale( m, [ 1, 2, 3 ] )\r\n  console.log( Matrix4.applyToVector3( scale, [ 4, 5, 6 ] ) ) // [ 4, 10, 18 ]\r\n}\r\n```\r\n\r\n### API\r\n```TypeScript\r\n// type matrix4 = Float32Array( 16 )\r\n// type quaternion = Float32Array( 4 ) [or use @3dlyra/quaternion]\r\n// type vector3 = Float32Array( 3 ) [or use @3dlyra/vector3]\r\n\r\ncreate(): matrix4;\r\ntranslate( m4: matrix4, v3: vector3 ): matrix4;\r\nrotateAxis( m4: matrix4, v3: vector3, radian: number ): matrix4;\r\nscale( m4: matrix4, v3: vector3 ): matrix4;\r\nfromQuaternion( q: quaternion ): matrix4;\r\napplyToVector3( m4: matrix4, v3: vector3 ): vector3;\r\n```\r\n","readmeFilename":"README.md"}