Miss any of our Open RFC calls?Watch the recordings here! »

trinomial-r

1.1.8 • Public • Published

trinomial-r

This package is used to solve, factorize and find the canonical form of a trinome (polynomial equation)

Contact me

If you have any questions do not hesitate to join me on my discord server

Install and exemple

npm i trinomial-r

  • The library can give an example of the returns of the functions allowing to solve, factorize and find the canonical form of a trinome.

CMD

npm run exemple

API

The different parameters of the functions tags

** solutions.OfThis ** factoring.this ** canonicalForm.OfThis

Some explications about the library

The library has a resolution and factorization algorithm that works on minimum values ​​for "a" and "b". Remember: a trinomial looks like this: "ax² + bx + c". If the values ​​for "a", "b" and "c" are not given, the algorithm will solve this trinome by giving as default value for "a" and "b": "1" and "c": 0.

  • For the polinomial roots the algorithm gives approximate default values
  • Due to the approximation of the roots of the trinomial, the method for factoring may be obsolete

Find the roots of a trinomial

const 
{
    solutions
} = require ('./trinomial-r');
 
const csl = console.log;
 
csl (solutions.OfThis ({
    a: -3,
    b: 5,
    c: 2
})); /* S = {0 ; 2} */

Factoring the equation

const 
{
    factoring
} = require ('./trinomial-r');
 
const csl = console.log;
 
csl (factoring.this ({
    a: -3,
    b: 5,
    c: 2
})); /* -3x(x - 2) */

Find the canonical form

const 
{
    canonicalForm
} = require ('./trinomial-r');
 
const csl = console.log;
 
csl (canonicalForm.OfThis ({
    a: -3,
    b: 5,
    c: 2
})); /* -3(x - 1) + 4 */
 
/*
* You can choose to display alpha and beta using the optional parameters
* showAlpha: true *** default value => false
* showBeta: true *** default value => false
*/
 
csl (canonicalForm.OfThis ({
    a: -3,
    b: 5,
    c: 2,
    showAlpha: true,
    showBeta: true
}));
 
/* show ***
* alpha = 1
* beta = 4
* -3(x - 1) + 4
*/

Parameters

solutions.OfThis

showEquation: true => default value: false

  • Shows the equation

showDelta: true => default value: false

  • Shows the discriminant of the equation

factoring.this

showEquation: true => default value: false

  • Shows the equation

showDelta: true => default value: false

  • Shows the discriminant of the equation

showRoots: true => default value: false

  • Shows roots of the equation

canonicalForm.OfThis

showEquation: true => default value: false

  • Shows the equation

showDelta: true => default value: false

  • Shows the discriminant of the equation

showAlpha: true => default value: false

  • Shows alpha

showBeta: true => default value: false

  • Shows beta

MIT License

Copyright (c) 2019 wazabix

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Install

npm i trinomial-r

DownloadsWeekly Downloads

16

Version

1.1.8

License

MIT

Unpacked Size

12.9 kB

Total Files

7

Last publish

Collaborators

  • avatar