Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/number"

Index

Functions

areNumbersEqual

  • areNumbersEqual(a: number, b: number): boolean
  • Indicates if the given numbers are equal

    export

    Parameters

    • a: number
    • b: number

    Returns boolean

deg2rad

  • deg2rad(deg: number): number
  • Converts the given angle in degrees to radians

    Parameters

    • deg: number

      The angle in degrees

    Returns number

getClosestScaleIndex

  • getClosestScaleIndex(scales: [number, number], scale: number): number
  • Gets the closest scale index for the given scale and scale array pair

    export

    Parameters

    • scales: [number, number]
    • scale: number

    Returns number

getFiniteScaleIndexForScale

  • getFiniteScaleIndexForScale(finiteScaleList: number[], scale: number): number
  • Gets the applicable finite scale index for the given scale and finite scale array

    export

    Parameters

    • finiteScaleList: number[]
    • scale: number

    Returns number

restrictToRange

  • restrictToRange(val: number, lower: number, upper: number): number
  • Restricts the given number to the given range

    export

    Parameters

    • val: number
    • lower: number
    • upper: number

    Returns number

roundTo

  • roundTo(num: number, decimals?: number): number
  • Rounds the given number to the specified number of decimals

    since

    0.11

    export

    Parameters

    • num: number
    • Default value decimals: number = 2

    Returns number

scaleRangeBetween

  • scaleRangeBetween(scale: number, minScale: number, maxScale: number): boolean
  • Indicates if the given scale is within the specified range

    export

    Parameters

    • scale: number
    • minScale: number
    • maxScale: number

    Returns boolean

sum

  • sum<T>(array: T[], numSelector: function): number
  • Computes the sum of the given array

    since

    0.11

    export
    template

    T

    Type parameters

    • T

    Parameters

    • array: T[]
    • numSelector: function
        • (item: T): number
        • Parameters

          • item: T

          Returns number

    Returns number

Generated using TypeDoc