{"class":{"name":"Phaser.Math","extends":"","static":true,"constructor":false,"parameters":[],"help":"A collection of mathematical methods."},"consts":[],"methods":{"public":[{"name":"Linear","static":false,"returns":{"types":["number"],"help":""},"help":"Calculates a linear value over t.","line":973,"public":true,"protected":false,"private":false,"parameters":[{"name":"p0","type":["number"],"help":"","optional":false,"default":null},{"name":"p1","type":["number"],"help":"","optional":false,"default":null},{"name":"t","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"PI2","static":false,"returns":null,"help":"= 2 π","line":18,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"angleBetween","static":false,"returns":{"types":["number"],"help":""},"help":"Find the angle of a segment from (x1, y1) -> (x2, y2).","line":338,"public":true,"protected":false,"private":false,"parameters":[{"name":"x1","type":["number"],"help":"","optional":false,"default":null},{"name":"y1","type":["number"],"help":"","optional":false,"default":null},{"name":"x2","type":["number"],"help":"","optional":false,"default":null},{"name":"y2","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"angleBetweenPoints","static":false,"returns":{"types":["number"],"help":""},"help":"Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).","line":365,"public":true,"protected":false,"private":false,"parameters":[{"name":"point1","type":["Phaser.Point"],"help":"","optional":false,"default":null},{"name":"point2","type":["Phaser.Point"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"angleBetweenPointsY","static":false,"returns":{"types":["number"],"help":""},"help":"Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).","line":376,"public":true,"protected":false,"private":false,"parameters":[{"name":"point1","type":["Phaser.Point"],"help":"","optional":false,"default":null},{"name":"point2","type":["Phaser.Point"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"angleBetweenY","static":false,"returns":{"types":["number"],"help":""},"help":"Find the angle of a segment from (x1, y1) -> (x2, y2).\\nNote that the difference between this method and Math.angleBetween is that this assumes the y coordinate travels\\ndown the screen.","line":354,"public":true,"protected":false,"private":false,"parameters":[{"name":"x1","type":["number"],"help":"","optional":false,"default":null},{"name":"y1","type":["number"],"help":"","optional":false,"default":null},{"name":"x2","type":["number"],"help":"","optional":false,"default":null},{"name":"y2","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"angleLimit","static":false,"returns":{"types":["number"],"help":"The new angle value, returns the same as the input angle if it was within bounds"},"help":"Keeps an angle value between the given min and max values.","line":859,"public":true,"protected":false,"private":false,"parameters":[{"name":"angle","type":["number"],"help":"The angle value to check. Must be between -180 and +180.","optional":false,"default":null},{"name":"min","type":["number"],"help":"The minimum angle that is allowed (must be -180 or greater).","optional":false,"default":null},{"name":"max","type":["number"],"help":"The maximum angle that is allowed (must be 180 or less).","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"average","static":false,"returns":{"types":["number"],"help":"The average of all given values."},"help":"Averages all values passed to the function and returns the result. You can pass as many parameters as you like.","line":86,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"bernstein","static":false,"returns":{"types":["number"],"help":""},"help":"","line":983,"public":true,"protected":false,"private":false,"parameters":[{"name":"n","type":["number"],"help":"","optional":false,"default":null},{"name":"i","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"bezierInterpolation","static":false,"returns":{"types":["number"],"help":""},"help":"A Bezier Interpolation Method, mostly used by Phaser.Tween.","line":910,"public":true,"protected":false,"private":false,"parameters":[{"name":"v","type":["array"],"help":"","optional":false,"default":null},{"name":"k","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"catmullRom","static":false,"returns":{"types":["number"],"help":""},"help":"Calculates a callmum rom value.","line":1020,"public":true,"protected":false,"private":false,"parameters":[{"name":"p0","type":["number"],"help":"","optional":false,"default":null},{"name":"p1","type":["number"],"help":"","optional":false,"default":null},{"name":"p2","type":["number"],"help":"","optional":false,"default":null},{"name":"p3","type":["number"],"help":"","optional":false,"default":null},{"name":"t","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"catmullRomInterpolation","static":false,"returns":{"types":["number"],"help":""},"help":"A Catmull Rom Interpolation Method, mostly used by Phaser.Tween.","line":931,"public":true,"protected":false,"private":false,"parameters":[{"name":"v","type":["array"],"help":"","optional":false,"default":null},{"name":"k","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"ceil","static":false,"returns":{"types":["number"],"help":"The rounded value of that number."},"help":"Round up to the next whole number. E.g. ceil(1.3) == 2, and ceil(-2.3) == -3.","line":1130,"public":true,"protected":false,"private":false,"parameters":[{"name":"value","type":["number"],"help":"Any number.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"ceilTo","static":false,"returns":{"types":["number"],"help":""},"help":"","line":306,"public":true,"protected":false,"private":false,"parameters":[{"name":"value","type":["number"],"help":"The value to round.","optional":false,"default":null},{"name":"place","type":["number"],"help":"The place to round to.","optional":false,"default":null},{"name":"base","type":["number"],"help":"The base to round in... default is 10 for decimal.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"chanceRoll","static":false,"returns":{"types":["boolean"],"help":"True if the roll passed, or false otherwise."},"help":"Generate a random bool result based on the chance value.\\n
\\nReturns true or false based on the chance value (default 50%). For example if you wanted a player to have a 30% chance\\nof getting a bonus, call chanceRoll(30) - true means the chance passed, false means it failed.\\n<\/p>","line":441,"public":true,"protected":false,"private":false,"parameters":[{"name":"chance","type":["number"],"help":"The chance of receiving the value. A number between 0 and 100 (effectively 0% to 100%).","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clamp","static":false,"returns":{"types":["number"],"help":""},"help":"Force a value within the boundaries of two values.\\nClamp value to range ","line":1276,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"","optional":false,"default":null},{"name":"a","type":["number"],"help":"","optional":false,"default":null},{"name":"b","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"clampBottom","static":false,"returns":{"types":["number"],"help":""},"help":"Clamp value to range b+ε"},"help":"a is fuzzyGreaterThan b if it is more than b - ε.","line":54,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["number"],"help":"","optional":false,"default":null},{"name":"b","type":["number"],"help":"","optional":false,"default":null},{"name":"epsilon","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"fuzzyLessThan","static":false,"returns":{"types":["boolean"],"help":"True if a to range \\nThe parameters allow you to specify the length, amplitude and frequency of the wave. Once you have called this function\\nyou should get the results via getSinTable() and getCosTable(). This generator is fast enough to be used in real-time.\\n<\/p>","line":1148,"public":true,"protected":false,"private":false,"parameters":[{"name":"length","type":["number"],"help":"The length of the wave","optional":false,"default":null},{"name":"sinAmplitude","type":["number"],"help":"The amplitude to apply to the sine table (default 1.0) if you need values between say -+ 125 then give 125 as the value","optional":false,"default":null},{"name":"cosAmplitude","type":["number"],"help":"The amplitude to apply to the cosine table (default 1.0) if you need values between say -+ 125 then give 125 as the value","optional":false,"default":null},{"name":"frequency","type":["number"],"help":" - The frequency of the sine and cosine table data","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"smootherstep","static":false,"returns":{"types":["number"],"help":""},"help":"Smootherstep function as detailed at http:\/\/en.wikipedia.org\/wiki\/Smoothstep","line":1353,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"","optional":false,"default":null},{"name":"min","type":["number"],"help":"","optional":false,"default":null},{"name":"max","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"smoothstep","static":false,"returns":{"types":["number"],"help":""},"help":"Smoothstep function as detailed at http:\/\/en.wikipedia.org\/wiki\/Smoothstep","line":1337,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"","optional":false,"default":null},{"name":"min","type":["number"],"help":"","optional":false,"default":null},{"name":"max","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"snapTo","static":false,"returns":{"types":["number"],"help":""},"help":"Snap a value to nearest grid slice, using rounding.\\n\\nExample: if you have an interval gap of 5 and a position of 12... you will snap to 10 whereas 14 will snap to 15.","line":133,"public":true,"protected":false,"private":false,"parameters":[{"name":"input","type":["number"],"help":"The value to snap.","optional":false,"default":null},{"name":"gap","type":["number"],"help":"The interval gap of the grid.","optional":false,"default":null},{"name":"start","type":["number"],"help":"Optional starting offset for gap.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"snapToCeil","static":false,"returns":{"types":["number"],"help":""},"help":"Snap a value to nearest grid slice, using ceil.\\n\\nExample: if you have an interval gap of 5 and a position of 12... you will snap to 15. As will 14 will snap to 15... but 16 will snap to 20.","line":185,"public":true,"protected":false,"private":false,"parameters":[{"name":"input","type":["number"],"help":"The value to snap.","optional":false,"default":null},{"name":"gap","type":["number"],"help":"The interval gap of the grid.","optional":false,"default":null},{"name":"start","type":["number"],"help":"Optional starting offset for gap.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"snapToFloor","static":false,"returns":{"types":["number"],"help":""},"help":"Snap a value to nearest grid slice, using floor.\\n\\nExample: if you have an interval gap of 5 and a position of 12... you will snap to 10. As will 14 snap to 10... but 16 will snap to 15","line":159,"public":true,"protected":false,"private":false,"parameters":[{"name":"input","type":["number"],"help":"The value to snap.","optional":false,"default":null},{"name":"gap","type":["number"],"help":"The interval gap of the grid.","optional":false,"default":null},{"name":"start","type":["number"],"help":"Optional starting offset for gap.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"snapToInArray","static":false,"returns":{"types":["number"],"help":""},"help":"Snaps a value to the nearest value in an array.","line":209,"public":true,"protected":false,"private":false,"parameters":[{"name":"input","type":["number"],"help":"","optional":false,"default":null},{"name":"arr","type":["array"],"help":"","optional":false,"default":null},{"name":"sort","type":["boolean"],"help":"True if the array needs to be sorted.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"truncate","static":false,"returns":{"types":["number"],"help":""},"help":"","line":109,"public":true,"protected":false,"private":false,"parameters":[{"name":"n","type":["number"],"help":"","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"within","static":false,"returns":{"types":["boolean"],"help":"True if a is <= tolerance of b."},"help":"Checks if two values are within the given tolerance of each other.","line":1305,"public":true,"protected":false,"private":false,"parameters":[{"name":"a","type":["number"],"help":"The first number to check","optional":false,"default":null},{"name":"b","type":["number"],"help":"The second number to check","optional":false,"default":null},{"name":"tolerance","type":["number"],"help":"The tolerance. Anything equal to or less than this is considered within the range.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"wrap","static":false,"returns":{"types":["number"],"help":"The wrapped value."},"help":"Ensures that the value always stays between min and max, by wrapping the value around.\\nmax should be larger than min, or the function will return 0.","line":614,"public":true,"protected":false,"private":false,"parameters":[{"name":"value","type":["number"],"help":"The value to wrap.","optional":false,"default":null},{"name":"min","type":["number"],"help":"The minimum the value is allowed to be.","optional":false,"default":null},{"name":"max","type":["number"],"help":"The maximum the value is allowed to be.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"wrapAngle","static":false,"returns":{"types":["number"],"help":"The new angle value, returns the same as the input angle if it was within bounds."},"help":"Keeps an angle value between -180 and +180.","line":843,"public":true,"protected":false,"private":false,"parameters":[{"name":"angle","type":["number"],"help":"The angle value to check","optional":false,"default":null},{"name":"radians","type":["boolean"],"help":"Set to `true` if the angle is given in radians, otherwise degrees is expected.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"wrapValue","static":false,"returns":{"types":["number"],"help":"The wrapped value."},"help":"Adds value to amount and ensures that the result always stays between 0 and max, by wrapping the value around.\\nValues must be positive integers, and are passed through Math.abs.","line":644,"public":true,"protected":false,"private":false,"parameters":[{"name":"value","type":["number"],"help":"The value to add the amount to.","optional":false,"default":null},{"name":"amount","type":["number"],"help":"The amount to add to the value.","optional":false,"default":null},{"name":"max","type":["number"],"help":"The maximum the value is allowed to be.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[],"protected":[],"private":[]}}