Fudge Core
    Preparing search index...

    Class CalcAbstract

    Abstract class supporting various arithmetical helper functions

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    deg2rad: number = ...

    factor multiplied with angle in degrees yields the angle in radian

    rad2deg: number = ...

    factor multiplied with angle in radian yields the angle in degrees

    Methods

    • Returns one of the values passed in, either _value if within _min and _max or the boundary being exceeded by _value.

      Type Parameters

      • T

      Parameters

      • _value: T
      • _min: T
      • _max: T
      • _isSmaller: (_value1: T, _value2: T) => boolean = ...

      Returns T

    • Returns the linear interpolation between two values. When t is 0 the result is a, when t is 1 the result is b. Clamps t between 0 and 1.

      Parameters

      • _a: number
      • _b: number
      • _t: number

      Returns number

    • Rounds the given value to the nearest multiple of the given increment using the given rounding function. Default rounding function is Math.round, use Math.floor or Math.ceil to round down or up.

      Parameters

      • _value: number
      • _increment: number
      • _round: (_value: number) => number = Math.round

      Returns number