thetajs
v1.1.1
Published
Syntatic sugar for [object Math]
Downloads
9
Maintainers
Readme
Theta ϴ
Syntatic Sugar for the default Math Object.
Installation
npm install thetajs
Usage
// Use Destructuring for the functions.
// Without destructuring, this is a waste of space
const { qube, sqrt, sq, log, sin, pi } = require('thetajs');
qube(64); // 4
sqrt(36); // 6
sq(3); // 9
log(10); // 1
sin(30); // 0.5
console.log(pi); // 3.141592653589793
API
pi: π. The ratio of the circumference of a circle to its diameter.
e: Euler's number. The mathematical constant e.
log10: The natural logarithm of 10.
lg2: The natural logarithms of 2.
sqrt(num): Returns the square root of a number.
cbrt(num): Returns the cube root of a number.
sq(num): Returns the square of a number.
cube(num): Returns the cube of a number.
qube(num): Returns number raised to the power of 4.
sin(angle): Returns the sine of an angle.
cos(angle): Returns the cosine of an angle.
tan(angle): Returns the tangent of an angle.
sini(angle): Returns the inverse sine of an angle.
cosi(angle): Returns the inverse cosine of an angle.
tani(angle): Returns the tangent cosine of an angle.
log(num): Returns the base 10 logarithm of a number.
log2(num): Returns the base e logarithm of a number.
loge(num): Returns the natural (base e) logarithm of a number.
round(num): Returns the nearest integer of the supplied value.
roundUp(num): Returns the highest nearest integer of the supplied value.
roundDown(num): Returns the lowest nearest integer of the supplied value.