{"name":"mumath","version":"3.3.4","description":"Practical math utils for components","main":"index.js","scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/dfcreative/mumath.git"},"keywords":["math","geometry"],"author":{"name":"dfcreative"},"license":"Unlicense","bugs":{"url":"https://github.com/dfcreative/mumath/issues"},"homepage":"https://github.com/dfcreative/mumath","dependencies":{"almost-equal":"^1.1.0"},"gitHead":"c714bce301520be6b37189625fc35bc222323a6a","_id":"mumath@3.3.4","_shasum":"48d4a0f0fd8cad4e7b32096ee89b161a63d30bbf","_from":".","_npmVersion":"3.7.2","_nodeVersion":"6.2.0","_npmUser":{"name":"dfcreative","email":"df.creative@gmail.com"},"maintainers":[{"name":"dfcreative","email":"df.creative@gmail.com"}],"dist":{"shasum":"48d4a0f0fd8cad4e7b32096ee89b161a63d30bbf","tarball":"http://registry-npm.ywwl.com/mumath/download/mumath-3.3.4.tgz","integrity":"sha512-VAFIOG6rsxoc7q/IaY3jdjmrsuX9f15KlRLYTHmixASBZkZEKC1IFqE2BC5CdhXmK6WLM1Re33z//AGmeRI6FA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDp267ZiGDkxO3cDSheeFWwcFxiD9VnulQEh32niOxdtAIhAOcDVS+GPwSQs+3vFIQ0Jn5S0L7Ee9DRaPX1pvWH7kdg"}],"size":6465,"noattachment":false,"key":"/mumath/-/mumath-3.3.4.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/mumath-3.3.4.tgz_1489010868223_0.9646028100978583"},"directories":{},"deprecated":"Redundant dependency in your project.","readme":"# μMath [![Build Status](https://travis-ci.org/dfcreative/mumath.svg?branch=master)](https://travis-ci.org/dfcreative/mumath) [![Code Climate](https://codeclimate.com/github/dfcreative/mumath/badges/gpa.svg)](https://codeclimate.com/github/dfcreative/mumath) <a href=\"UNLICENSE\"><img src=\"http://upload.wikimedia.org/wikipedia/commons/6/62/PD-icon.svg\" width=\"20\"/></a>\r\n\r\nSet of practical math utils to shorten code.\r\n\r\n[`$ npm install mumath`](https://npmjs.org/package/mumath)\r\n\r\n```js\r\nvar round = require('mumath/round');\r\nround(123.32, .5); //123.5\r\n\r\n//require any function as\r\n//var <fn> = require('mumath/<fn>');\r\n```\r\n\r\n## API\r\n\r\n### `round(value, step?)`\r\n\r\nRounds value to optional `step`.\r\n\r\n`round(0.3, .5)` → `.5`\r\n\r\n\r\n### `len(a, b)`\r\n\r\nReturn length of a vector.\r\n\r\n\r\n### `precision(value)`\r\n\r\nGet precision from float:\r\n\r\n`1.1 → 1, 1234 → 0, .1234 → 4`\r\n\r\n\r\n### `clamp(value, left, right)`\r\n\r\nReturn value clamped by left/right limits (or vice-versa).\r\n\r\n\r\n### `lerp(x, y, ratio)`\r\n\r\nReturn value interpolated between x and y.\r\n\r\n\r\n### `within(value, left, right)`\r\n\r\nWhether element is between left & right, including.\r\n\r\n\r\n### `mod(value, min?, max)`\r\n\r\nAn enhanced [mod-loop](http://npmjs.org/package/mod-loop) — loops value within a frame.\r\n\r\n\r\n### `closest(value, list)`\r\n\r\nGet closest value out of a set.\r\n\r\n\r\n### `scale(value, list)`\r\n\r\nGet first scale out of a list of basic scales, aligned to the power. E. g.\r\n\r\n`step(.37, [1, 2, 5])` → `.5`\r\n`step(456, [1, 2])` → `1000`\r\n\r\nSimilar to closest, but takes all possible powers of scales.\r\n\r\n### `order(value)`\r\n\r\nGet order of magnitude for a number.\r\n\r\n`order(123) → 100; order(-0.0003) → 0.0001;`\r\n\r\n\r\n### `isMultiple(a, b, eps?)`\r\n\r\nSame as `a % b === 0`, but with precision check.\r\n\r\n\r\n## Related\r\n\r\n* [bit-twiddle](https://www.npmjs.com/package/bit-twiddle) — utils for power-of-two numbers.\r\n* [pretty-number](https://www.npmjs.com/package/pretty-number) — format number to pretty view.\r\n","publish_time":1489010868449,"_cnpm_publish_time":1489010868449,"dist-tags":{"latest":"3.3.4"}}