Options
All
  • Public
  • Public/Protected
  • All
Menu
description

The main service for handling certain mathematical operations such as generating a random number, etc.

since

v0.4.0

Hierarchy

  • MathService

Index

Constructors

Properties

Methods

Constructors

Properties

RNG: (() => number) = Math.random

Type declaration

    • (): number
    • Returns a pseudorandom number between 0 and 1.

      var

      {any|callable}

      Returns number

Methods

  • getRandomVariates(): number[]
  • skewNormal(mean: number, deviation: number, skewness?: number): number
  • This method can be used to generate random numbers for which the deviation from the mean value is given.

    The skew-normal distribution implementation which uses the {@link random} method to get the pair of random variates then calculates a coefficient and produces a skew-normal variate using the deviation and skewness as described in the linked article.

    link

    https://spin.atomicobject.com/2019/09/30/skew-normal-prng-javascript/

    Parameters

    • mean: number

      The location or "mean" value.

    • deviation: number

      The standard deviation.

    • skewness: number = 0

      The skewness, if 0 uses only deviation.

    Returns number

Generated using TypeDoc