vec2-fn
    Preparing search index...

    Function approx

    • Calculate whether two vectors are approximately equal.

      Parameters

      • v1: Vec2Param

        First vector for comparison.

      • v2: Vec2Param

        Second vector for comparison.

      • threshold: number = APPROX_THRESHOLD

        The comparison threshold. Defaults to APPROX_THRESHOLD.

      Returns boolean

      • Whether the vectors are approximately equal or not.
      approx({ x: 0.1 + 0.2, y: 0 }, { x: 0.3, y: 0 }); // -> true