{"_id":"rat-vec","_rev":"7-0321776a9deae2cacbca544cf5f62f3c","name":"rat-vec","description":"Exact rational vector arithmetic","dist-tags":{"latest":"1.1.1"},"versions":{"0.0.0":{"name":"rat-vec","version":"0.0.0","description":"Exact rational vector arithmetic","main":"index.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/rat-nest/rat-vec.git"},"keywords":["rational","vector","exact","arithmetic","geometry"],"authors":["Mikola Lysenko","Elijah Insua"],"license":"MIT","bugs":{"url":"https://github.com/rat-nest/rat-vec/issues"},"homepage":"https://github.com/rat-nest/rat-vec#readme","dependencies":{"bit-twiddle":"^1.0.2","bn.js":"^2.0.4","double-bits":"^1.1.1"},"devDependencies":{"tape":"^4.0.0"},"gitHead":"3272a046b23dac138bcf85c002bdf06e6e7f0c14","_id":"rat-vec@0.0.0","_shasum":"3ab5369980832475b3a2b09a570413b7576ee707","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"dist":{"shasum":"3ab5369980832475b3a2b09a570413b7576ee707","tarball":"https://registry.npmjs.org/rat-vec/-/rat-vec-0.0.0.tgz","integrity":"sha512-MpBZ4v/ThKuxwK7g7sRDs1xuRhNOo+2b2fFLTEVL3UaB+agD8PvbsgMBac8/QrFojAVxxfj5yaVh0ht/dpwJ7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEDTLZvE+RewSulmaOlikCWDLhTsxuWHcAIr7fEI1AgJAiEAsdY89enlqmTJi3UG+jNZVBZezBkFJ0OvRi7OnvJHnOY="}]},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"1.0.0":{"name":"rat-vec","version":"1.0.0","description":"Exact rational vector arithmetic","main":"index.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/rat-nest/rat-vec.git"},"keywords":["rational","vector","exact","arithmetic","geometry"],"authors":["Mikola Lysenko","Elijah Insua"],"license":"MIT","bugs":{"url":"https://github.com/rat-nest/rat-vec/issues"},"homepage":"https://github.com/rat-nest/rat-vec#readme","dependencies":{"big-rat":"^1.0.0"},"devDependencies":{"tape":"^4.0.0"},"gitHead":"ed7391331dae57ff7cdeb5af84efc5c6e1a445b2","_id":"rat-vec@1.0.0","_shasum":"d488f5000d95666cfebbe5fb34bdece9b39cca64","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"dist":{"shasum":"d488f5000d95666cfebbe5fb34bdece9b39cca64","tarball":"https://registry.npmjs.org/rat-vec/-/rat-vec-1.0.0.tgz","integrity":"sha512-TmMMYRsmmnEXxAIdWBC+sP7DtpIIYz9zegs8HObFHTVQYSoXJk5Md2zhOwcSQf/auje1ywPUf+dNtEsNvy8Vuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDE6BUQmKA9xXDxHDgp40PWUVN0tuQerJHP9ne6wd9f3AiB2oXKkuFSpDj1/EImGduanPfQ4F1PNZEJdGM0P/Yz7Bw=="}]},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"tmpvar","email":"tmpvar@gmail.com"}]},"1.1.0":{"name":"rat-vec","version":"1.1.0","description":"Exact rational vector arithmetic","main":"index.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/rat-nest/rat-vec.git"},"keywords":["rational","vector","exact","arithmetic","geometry"],"authors":["Mikola Lysenko","Elijah Insua"],"license":"MIT","bugs":{"url":"https://github.com/rat-nest/rat-vec/issues"},"homepage":"https://github.com/rat-nest/rat-vec#readme","dependencies":{"big-rat":"^1.0.0"},"devDependencies":{"tape":"^4.0.0"},"gitHead":"ed4f65c6e840788e901dedf8021a2183c40ecb44","_id":"rat-vec@1.1.0","_shasum":"124e5b33f9ff310316965a47e6147bc0875ec85e","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"dist":{"shasum":"124e5b33f9ff310316965a47e6147bc0875ec85e","tarball":"https://registry.npmjs.org/rat-vec/-/rat-vec-1.1.0.tgz","integrity":"sha512-Hai8LQos1Vca4lGs93SLr3UhUPXz2kmgbW2zpO03JPfOKgLwrvmbl++uvXLBANqhFUEObMCOmP4TzxBrcaWhzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDu9RGRvf4KS+nm6HHwDqfPgn+LH2Bvg8l8+ks/gqj0hAiAshI9w4oOcbESfZAFeml3beEj59n69I15i2CEdN5LySA=="}]},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"tmpvar","email":"tmpvar@gmail.com"}]},"1.1.1":{"name":"rat-vec","version":"1.1.1","description":"Exact rational vector arithmetic","main":"index.js","scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/rat-nest/rat-vec.git"},"keywords":["rational","vector","exact","arithmetic","geometry"],"authors":["Mikola Lysenko","Elijah Insua"],"license":"MIT","bugs":{"url":"https://github.com/rat-nest/rat-vec/issues"},"homepage":"https://github.com/rat-nest/rat-vec#readme","dependencies":{"big-rat":"^1.0.3"},"devDependencies":{"tape":"^4.0.0"},"gitHead":"731a528304bd6aec94f83389090b52597c9f368f","_id":"rat-vec@1.1.1","_shasum":"0dde2b66b7b34bb1bcd2a23805eac806d87fd17f","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.7.0","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"dist":{"shasum":"0dde2b66b7b34bb1bcd2a23805eac806d87fd17f","tarball":"https://registry.npmjs.org/rat-vec/-/rat-vec-1.1.1.tgz","integrity":"sha512-FbxGwkQxmw4Jx41LR7yMOR+g8M9TWCEmf/SUBQVLuK2eh0nThnffF7IUualr3XE2x5F8AdLiCVeSGwXd4snfgg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDItxhqZdKn3tk87ZRgzXNXeKArJd6RZjSIq7+hcEjLeQIhAMnyTmBgXYZnMgGd6RZWOnS0pIKeDVnKbykMe2kzCLqq"}]},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"tmpvar","email":"tmpvar@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/rat-vec-1.1.1.tgz_1483723609572_0.45332587440498173"}}},"readme":"rat-vec\n=======\nExact rational vector arithmetic.\n\n<img src=\"img/rat.jpg\">\n\nrat-vec is *slow* but reliable.  You can use it to get quickly and reliably\nimplement geometric algorithms, then go back and smash your head into a wall\ntrying to optimize them with filters and predicates and snap rounding and so on.\n\nThis library is built on top of [bn.js](https://github.com/indutny/bn.js/)\n\n# Example\n\n```javascript\nvar vec = require('rat-vec')\n\nvar toFloat = require('rat-vec/to-float')\n\nvar add = require('rat-vec/add')\n\nvar sub = require('rat-vec/sub')\n\nvar dot = require('rat-vec/sub')\n\n```\n\n# Install\n\n```\nnpm i rat-vec\n```\n\n# API\n\nA `rat-vec` is an array of [`big-rat`s](https://github.com/rat-nest/big-rat).\n\n#### `var r = require('rat-vec')(v)`\nConverts a vector of `n` floating point numbers into an exact rational vector of `n+1` big ints.\n\n* `v` is a vector of floats, `big-rat`s or strings\n\n**Returns** A rational vector of big integers\n\n#### `require('rat-vec/is-vec')(v)`\nTest if `v` is a rat-vec\n\n#### `var v = require('rat-vec/to-float')(r)`\nRounds a vector of big-rats into a\n\n* `r` is a vector of `n` big integers\n\n**Returns** A vector of `n` floats representing the closest representable vector\n\n#### `var s = require('rat-vec/add')(a, b)`\n\n**Returns** The vector sum of `a` and `b`\n\n#### `var d = require('rat-vec/sub')(a, b)`\n\n**Returns** The vector difference of `a` and `b`\n\n#### `var f = require('rat-vec/dot')(a, b)`\n\n**Returns** The dot product of `a` and `b`\n\n#### `var v = require('rat-vec/muls')(a, s)`\n\n**Returns** The scalar product of `a` and `s`, where `s` is a float, big-rat or string\n\n#### `var v = require('rat-vec/divs')(a, s)`\n\n**Returns** `a` divided by the scalar `s`\n\n#### `var lerp = require('rat-vec/lerp')(a, b, t)`\n\nLinearly interpolate between `a` and `b` with parameter `t`\n\n#### `var c = require('rat-vec/cmp')(a, b)`\nCompares the components of `a` and `b`, returns an array of `0,+1,-1` whose components are the result of comparing each value.\n\n#### `var eq = require('rat-vec/equals')(a, b)`\nTest if two rational vectors are equal.\n\n#### `var h = require('rat-vec/max')(a, b)`\nComputes the component-wise maximum of `a` and `b`\n\n#### `var l = require('rat-vec/min')(a, b)`\nComputes the component-wise minimum of `a` and `b`\n\n#### `var p = require('rat-vec/mul')(a, b)`\nComputes the component-wise product of `a` and `b`\n\n#### `var r = require('rat-vec/recip')(a)`\nComputes the component-wise reciprocal of `a`\n\n#### `var q = require('rat-vec/div')(a, b)`\nComputes the component-wise quotient of `a` and `b`\n\n#### `var n = require('rat-vec/neg')(x)`\nComputes the additive inverse of `x`\n\n#### `var n = require('rat-vec/abs')(x)`\nComputes the component-wise absolute value of `x`\n\n# Credits\n\n(c) 2015, MIT License\n\n[Rat logo CC licensed, (c) La Tarte Au Citron](https://www.flickr.com/photos/tartaucitron/11328783804/in/photolist-ig5YJG-6rds6G-9ZBxcz-b9JfZ-5qdtpw-5e48pj-i6RTUn-4BbDwn-ag7YHX-9ZEtw3-7dV4fm-i6Sh6L-ieVirs-9ntyy-i6S2d9-5UAf8v-9ZBweF-qdmsJJ-aioESD-4AQEj5-9iL3y4-b4yPpk-furjEV-5UExDy-mgNSyg-5y7RQ5-ddxkgR-RTNKs-9ZEna9-5UT4cs-uZnbz-YWUx-aDRSKQ-dtTDuN-ieVsZV-5y3sLe-5TrTjY-uaN1h-5y3icB-5XjCbR-dm3VZC-5R32Eb-7ZKsBm-9ZBx4g-7TVNKb-bkJN5N-9hyNho-9ZBvwe-9ZEnmq-9ZEnsy)\n","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"tmpvar","email":"tmpvar@gmail.com"}],"time":{"modified":"2022-06-25T13:00:29.722Z","created":"2015-05-18T14:22:59.552Z","0.0.0":"2015-05-18T14:22:59.552Z","1.0.0":"2015-05-25T15:22:08.712Z","1.1.0":"2015-05-25T17:03:53.959Z","1.1.1":"2017-01-06T17:26:51.704Z"},"homepage":"https://github.com/rat-nest/rat-vec#readme","keywords":["rational","vector","exact","arithmetic","geometry"],"repository":{"type":"git","url":"git+https://github.com/rat-nest/rat-vec.git"},"bugs":{"url":"https://github.com/rat-nest/rat-vec/issues"},"license":"MIT","readmeFilename":"README.md"}