Options
All
  • Public
  • Public/Protected
  • All
Menu

Module math

Utility functions for math.

Index

Functions

Functions

wrapAround

  • wrapAround(index: number, length: number): number
  • Wraps an index around a given range.

    Parameters

    • index: number

      The number to wrap within 0 to length, so if this was -1 the result would be length-1.

    • length: number

      The right bound to wrap around back to 0 from.

    Returns number

    The index "wrapped around" 0 to length. 0 <= result < length.

Generated using TypeDoc