Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MathUtil

A utility class containing methods you might need for math problems.

Hierarchy

  • MathUtil

Index

Properties

Static Protected TWO_PI

TWO_PI: number

Methods

Static clamp

  • clamp(value: number, min: number, max: number): number

Static deg2rad

  • deg2rad(deg: number): number

Static getNextPowerOfTwo

  • getNextPowerOfTwo(number: number): number

Static intersectLineWithXYPlane

  • intersectLineWithXYPlane(pointA: Vector3D, pointB: Vector3D, out?: Point): Point
  • Calculates the intersection point between the xy-plane and an infinite line that is defined by two 3D points in the same coordinate system.

    Parameters

    • pointA: Vector3D
    • pointB: Vector3D
    • Optional out: Point

    Returns Point

Static isEquivalent

  • isEquivalent(a: number, b: number, epsilon?: number): boolean
  • Indicates if two float (Number) values are equal, give or take epsilon.

    Parameters

    • a: number
    • b: number
    • Optional epsilon: number

    Returns boolean

Static isPointInTriangle

  • isPointInTriangle(p: Point, a: Point, b: Point, c: Point): boolean

Static max

  • max(a: number, b: number): number
  • Returns the larger of the two values. Different to the native Math.max, this doesn't create any temporary objects when using the AOT compiler.

    Parameters

    • a: number
    • b: number

    Returns number

Static min

  • min(a: number, b: number): number
  • Returns the smaller of the two values. Different to the native Math.min, this doesn't create any temporary objects when using the AOT compiler.

    Parameters

    • a: number
    • b: number

    Returns number

Static minValues

  • minValues(values: Array<number>): number

Static normalizeAngle

  • normalizeAngle(angle: number): number

Static rad2deg

  • rad2deg(rad: number): number

Static toFixed

  • toFixed(value: number, precision: number): string

Generated using TypeDoc