Options
All
  • Public
  • Public/Protected
  • All
Menu

Precision utilities.

Hierarchy

  • Precision

Index

Constructors

Properties

FLOAT_EPSILON: number = 1e-3

Methods

  • almostEqualsNumber(value1: number, value2: number, acceptableDifference?: number): boolean
  • Checks if two numbers are equal with a given tolerance.

    Parameters

    • value1: number

      The first number.

    • value2: number

      The second number.

    • acceptableDifference: number = ...

      The acceptable difference as threshold. Default is Precision.FLOAT_EPSILON = 1e-3.

    Returns boolean

  • almostEqualsVector(vec1: Vector2, vec2: Vector2, acceptableDifference?: number): boolean
  • Checks if two vectors are equal with a given tolerance.

    Parameters

    • vec1: Vector2

      The first vector.

    • vec2: Vector2

      The second vector.

    • acceptableDifference: number = ...

      The acceptable difference as threshold. Default is Precision.FLOAT_EPSILON = 1e-3.

    Returns boolean

Generated using TypeDoc