Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils/math

Index

Functions

Const clamp

  • clamp(num: number, min: number, max: number): number
  • Clamp number to a given range

    Parameters

    • num: number
    • min: number
    • max: number

    Returns number

Const isPowerOf2

  • isPowerOf2(value: number): boolean
  • Check if number is power of 2

    Parameters

    • value: number

    Returns boolean

Const mapNumberRange

  • mapNumberRange(val: number, inMin: number, inMax: number, outMin: number, outMax: number): number
  • Parameters

    • val: number
    • inMin: number
    • inMax: number
    • outMin: number
    • outMax: number

    Returns number

Const normalizeNumber

  • normalizeNumber(min: number, max: number, val: number): number
  • Normalizes a number

    Parameters

    • min: number
    • max: number
    • val: number

    Returns number

Const triangleWave

  • triangleWave(t: number): number

Generated using TypeDoc