Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "bounds"

Index

Functions

Functions

Const bounds

  • bounds(pts: ReadonlyArray<Vec>, vmin: Vec, vmax: Vec): VecPair
  • Computes the nD bounds of given vectors. vmin should be initialized to +∞ and vmax to -∞ (e.g. use copies of MIN* / MAX* constants defined in thi.ng/vectors).

    example
    points = [[-1,-2], [5,-3], [0,4]];
    
    bounds(points, [...MAX2], [...MIN2])
    // [[-1,-3],[5,4]]

    Returns 2-tuple of modified [vmin, vmax].

    Parameters

    • pts: ReadonlyArray<Vec>

      point

    • vmin: Vec

      min result (pre-initialized to +∞)

    • vmax: Vec

      max result (pre-initialized to -∞)

    Returns VecPair

Generated using TypeDoc