mumath

WebJar for mumath

License

License

GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

mumath
Last Version

Last Version

3.3.4
Release Date

Release Date

Type

Type

jar
Description

Description

mumath
WebJar for mumath
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/dfcreative/mumath

Download mumath

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mumath/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mumath</artifactId>
    <version>3.3.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mumath/
implementation 'org.webjars.npm:mumath:3.3.4'
// https://jarcasting.com/artifacts/org.webjars.npm/mumath/
implementation ("org.webjars.npm:mumath:3.3.4")
'org.webjars.npm:mumath:jar:3.3.4'
<dependency org="org.webjars.npm" name="mumath" rev="3.3.4">
  <artifact name="mumath" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mumath', version='3.3.4')
)
libraryDependencies += "org.webjars.npm" % "mumath" % "3.3.4"
[org.webjars.npm/mumath "3.3.4"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : almost-equal jar [1.1.0,2)

Project Modules

There are no modules declared in this project.

μMath Build Status Code Climate

Set of practical math utils to shorten code.

$ npm install mumath

var round = require('mumath/round');
round(123.32, .5); //123.5

//require any function as
//var <fn> = require('mumath/<fn>');

API

round(value, step?)

Rounds value to optional step.

round(0.3, .5).5

len(a, b)

Return length of a vector.

precision(value)

Get precision from float:

1.1 → 1, 1234 → 0, .1234 → 4

clamp(value, left, right)

Return value clamped by left/right limits (or vice-versa).

lerp(x, y, ratio)

Return value interpolated between x and y.

within(value, left, right)

Whether element is between left & right, including.

mod(value, min?, max)

An enhanced mod-loop — loops value within a frame.

closest(value, list)

Get closest value out of a set.

scale(value, list)

Get first scale out of a list of basic scales, aligned to the power. E. g.

step(.37, [1, 2, 5]).5 step(456, [1, 2])1000

Similar to closest, but takes all possible powers of scales.

order(value)

Get order of magnitude for a number.

order(123) → 100; order(-0.0003) → 0.0001;

isMultiple(a, b, eps?)

Same as a % b === 0, but with precision check.

Related

Versions

Version
3.3.4