Skip to content

Tiny script for counting examples of several math situation types. It's still being built.

Notifications You must be signed in to change notification settings

pesout/countiny.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 

Repository files navigation

Countiny

Tiny script for counting examples of several math situations. All functions expect valid input.

It's possible to include it directy:

<script src="http://pesout.github.io/countiny.js/countiny.js"></script>

Features

Quadratic formula

countiny_quad(a, b, c, x);
  • A, B and C - Coefficients
  • X - A root number (1 or 2)

Combinatorics

Factorial

countiny_fctr(a);

Cobmination number

countiny_comb(n, k);
  • Numerator: n!
  • Denominator: k! * (n-k)!

Variation

countiny_vari(n, k);
  • Numerator: n!
  • Denominator: (n-k)!

Logarithmic

Arbitary-based logarithm

countiny_alog(a, x);
  • Base: a
  • Argument: x
  • Numerator: log(x)
  • Denominator: log(a)

Roots

N-th root

countiny_root(x, n);
  • n-th root formula

Angles

Degrees to radians

countiny_dgrd(deg);

Degrees to radians expressed in multiples of pi

countiny_dgrd_pi(deg, pi_sign);
  • deg - input
  • pi_sign: logic variable (true or false)
  • If pi_sign is true, output will look like
  • If not, output will look like 2

Radians to degrees

countiny_rddg(rad);

Percentage

  • a - A whole number
  • b - A value of percentages
  • c - A part of a whole number

A part of a whole number and a value of percentages (of this part)

countiny_perc_part(a, b);

A whole number from a part and a value of percentages

countiny_perc_whol(b, c);

Percentages, which means a part of the whole number

countiny_perc_pers(b, c);

Is a number in a range?

countiny_rang(a, min, max);
  • a - the number
  • min - minimal value in the range
  • max - maximal value in the range
  • This function returns true or false

Rounding

Rounding to N decimal places

countiny_nrnd(num, dec);
  • num - an input number
  • dec - how many decimal places

Releases

No releases published

Packages

No packages published