{"name":"mumath","version":"3.2.2","description":"Practical math utils for components","main":"index.js","files":["*.js"],"scripts":{"test":"node test/index.js"},"repository":{"type":"git","url":"git://github.com/dfcreative/mumath.git"},"keywords":["math","geometry"],"author":{"name":"dfcreative"},"license":"unlicensed","bugs":{"url":"https://github.com/dfcreative/mumath/issues"},"homepage":"https://github.com/dfcreative/mumath","dependencies":{"almost-equal":"^1.1.0"},"gitHead":"8070ca5d40e413a400b85623175f1e3423817447","_id":"mumath@3.2.2","_shasum":"5c16279b5fe7ba4e3b1628e1c095434e400abc32","_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":"5c16279b5fe7ba4e3b1628e1c095434e400abc32","tarball":"http://registry-npm.ywwl.com/mumath/download/mumath-3.2.2.tgz","integrity":"sha512-CzHlHcbceI5oBGq+ZJCkew/1yarPoOtY2Hq3rX8HXeqSRTokCI9JFFl5qYgg4MMQvpGYlxoq6k5YnKiec+flbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoI6Jiws33yAG7IWXFjehtgubTh1OMUO7+uJkmjJLezwIgGGeTZDlitlZ5C8SYIbyd+P5JoUxGl9sn27KjZzQm2HI="}],"size":3845,"noattachment":false,"key":"/mumath/-/mumath-3.2.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/mumath-3.2.2.tgz_1477165563814_0.519882733002305"},"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":1477165565924,"_cnpm_publish_time":1477165565924,"dist-tags":{"latest":"3.3.4"}}