Math#within()

within(a, b, tolerance) → {boolean}

Checks if two values are within the given tolerance of each other.

Parameters
Name Type Description
a number

The first number to check

b number

The second number to check

tolerance number

The tolerance. Anything equal to or less than this is considered within the range.

Returns
boolean -

True if a is <= tolerance of b.

Source code: math/Math.js (Line 1069)
See
  • Phaser.Math.fuzzyEqual
doc_phaser
2017-02-14 10:55:06
Comments
Leave a Comment

Please login to continue.