MATHEMATICS

Members

(static, constant) RADIANS :number

Description:
  • The value to convert an angle from degrees to radians.
Source:
The value to convert an angle from degrees to radians.
Type:
  • number

(static, constant) SQRT_2 :number

Description:
  • The value of square root of 2 (rounded to the millionth).
Source:
The value of square root of 2 (rounded to the millionth).
Type:
  • number

Methods

(static) clamp($x, $minimum, $maximum) → {number}

Description:
  • Clamps the given value between two given bounds.
Source:
Parameters:
Name Type Default Description
$x number The value to clamp.
$minimum number 0 The minimum bound.
$maximum number 1 The maximum bound.
Returns:
Type
number

(static) hypotenuse($ab, $ac) → {number}

Description:
  • Gets the length of the hypotenuse of a right triangle from the two given legs.
Source:
Parameters:
Name Type Description
$ab number The length of the first leg.
$ac number The length of the second leg.
Returns:
Type
number

(static) normalize($x, $minimum, $maximum) → {number}

Description:
  • Normalizes the given value within the given range.
Source:
Parameters:
Name Type Description
$x number The value to normalize.
$minimum number The minimum value of the range.
$maximum number The maximum value of the range.
Returns:
Type
number