Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mathematics

Class who contains all elements relatives to the Mathematics sciences.

author

Nicolas GILLE nic.gille@gmail.com

since

0.1.0

version

1.0

license

MIT

Hierarchy

  • Mathematics

Index

Constructors

constructor

Methods

euclideanAlgorithm

  • euclideanAlgorithm(a: number, b: number): number
  • Euclidean algorithm to compute the Greatest Common Divisor or GCD.

    since

    0.1.0

    version

    1.0

    Parameters

    • a: number
    • b: number

    Returns number

    The greatest common divisor between the operand A et operand B.

interceptTheorem

  • interceptTheorem(ad: number, ab: number, ae: number, ac: number, de: number, bc: number): object
  • Application of the Thales Theorem used to compute 2 of the 6 side's size missing.

    since

    0.1.0

    version

    1.0

    Parameters

    • ad: number

      Length of the segment AD.

    • ab: number

      Length of the segment AB.

    • ae: number

      Length of the segment AE.

    • ac: number

      Length of the segment AC.

    • de: number

      Length of the segment DE.

    • bc: number

      Length of the segment BC.

    Returns object

    An object with the length of each segments expected as an associative array with the name of the segment as key and the size of the segment as value.

interceptTheoremConverse

  • interceptTheoremConverse(ad: number, ab: number, ae: number, ac: number, precision?: number): boolean
  • Indicate if the segment [DE] and [BC] are parallel or not.

    since

    0.1.0

    version

    1.1

    Parameters

    • ad: number

      Length of segment AD.

    • ab: number

      Length of segment AB.

    • ae: number

      Length of segment AE.

    • ac: number

      Length of segment AC.

    • Default value precision: number = 2

      Precision of the result excepted. By default, the number of digit expected is equal at 2 digits.

    Returns boolean

    A boolean to indicate if the segment [DE] and [BC] are parallel or not.

isMersenneNumber

  • isMersenneNumber(x: number): boolean

isPrimeNumber

  • isPrimeNumber(x: number): boolean
  • Check if a number is a prime number or not.

    since

    0.4.0

    version

    1.0

    Parameters

    • x: number

      Number to check is a prime number.

    Returns boolean

    True if x is a prime number.

lcmAlgorithm

  • lcmAlgorithm(a: number, b: number): number
  • Get the Least Common Multiple (LCM) of two numbers.

    since

    0.1.0

    version

    1.0

    Parameters

    • a: number

      A number.

    • b: number

      Another number.

    Returns number

    The least common multiple between a and b.

lineSlope

  • Compute the slope of a line.

    throws

    {Error} Thrown an Error when the denominator is equal to 0.

    see

    Point

    since

    0.4.0

    version

    1.0

    Parameters

    Returns number

    The slope of the line.

pythagoreanTheorem

  • pythagoreanTheorem(hypotenuse: number, cathetus1: number, cathetus2: number): boolean
  • Pythagorean theorem used to check if a triangle is right or not.

    since

    0.1.0

    version

    1.1

    Parameters

    • hypotenuse: number

      Hypotenuse of the potential right triangle

    • cathetus1: number

      First cathetus of the potential right triangle.

    • cathetus2: number

      Seconde cathetus of the potential right triangle.

    Returns boolean

    A boolean to indicate if the triangle is right or not.

pythagoreanTheoremConverse

  • pythagoreanTheoremConverse(hypotenuse: number, cathetus1: number, cathetus2: number): number
  • Compute the thirds side of a right triangle. To this, get two sizes to compute the last size.

    throws

    {Error} Will throw if 2 of the 3 values expected are NaN.

    since

    0.1.0

    version

    1.1

    Parameters

    • hypotenuse: number

      Hypotenuse of the triangle.

    • cathetus1: number

      First side of the triangle.

    • cathetus2: number

      Second side of the triangle.

    Returns number

    The size of the third value of the right triangle.

Generated using TypeDoc