Options
All
  • Public
  • Public/Protected
  • All
Menu

General math-related and numeric utility functions.

Hierarchy

  • MathUtils

Index

Constructors

Methods

Constructors

Private constructor

Methods

Static distance

  • distance(aX: number, aY: number, bX: number, bY: number): number
  • Parameters

    • aX: number

      point A x coordinate

    • aY: number

      point A y coordinate

    • bX: number

      point B x coordinate

    • bY: number

      point B y coordinate

    Returns number

    Euclidean distance between points A and B

Static round

  • round(d: number): number
  • Ends up being a bit faster than {@link Math#round(float)}. This merely rounds its argument to the nearest int, where x.5 rounds up to x+1. Semantics of this shortcut differ slightly from {@link Math#round(float)} in that half rounds down for negative values. -2.5 rounds to -3, not -2. For purposes here it makes no difference.

    Parameters

    • d: number

      real value to round

    Returns number

    nearest {@code int}

Static sum

  • sum(array: Int32Array): number

Generated using TypeDoc