{"name":"mumath","version":"3.3.1","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":"unlicensed","bugs":{"url":"https://github.com/dfcreative/mumath/issues"},"homepage":"https://github.com/dfcreative/mumath","dependencies":{"almost-equal":"^1.1.0"},"gitHead":"12f78574dce2f2ea227527045a4ee9a897230f6d","_id":"mumath@3.3.1","_shasum":"264b3d610d7a0a4e574ff282424b5427be0b0c96","_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":"264b3d610d7a0a4e574ff282424b5427be0b0c96","tarball":"http://registry-npm.ywwl.com/mumath/download/mumath-3.3.1.tgz","integrity":"sha512-AFsUpLLVC27qiCBEqH1x5FM9WyRbr5ChTVk8tJTT25y7Zuc4SWESh3cPl1cfkNRH6wZYZ/+yaTYcg+aDk1YmsA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDnGBooyU3cEte8eVgxR6Wg583ZafzwuAUDNFcxxFIIyAIgJxPWoaYcpt9SZxMeDlKZ6WczxWg9Ji6aVf+WUompyDA="}],"size":6564,"noattachment":false,"key":"/mumath/-/mumath-3.3.1.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/mumath-3.3.1.tgz_1477255849335_0.10613371129147708"},"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":1477255850694,"_cnpm_publish_time":1477255850694,"dist-tags":{"latest":"3.3.4"}}