amukh1 / Algebra_calculus

Repository with things related to Algebra and Calculus within Javascript

Home Page:https://amukh1.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Algebra (In js)

Quadratics

https://web.stanford.edu/~surag/posts/alphazero.html

For example: ax^2 + bx + c = 0

Warning THE PARSE FUNCTION REQUIRES IT TO BE IN ax^2 + bx + c = 0 FORM

Warning THE QUADRATIC FUNCTION NEEDS TO BE FED AN A, B, AND C VALUE FOR IT TO WORK.

Functions:

quadratic(a, b, c) --> returns two polynomial answers that can be zero.

Note returns two polynomial answers that can be zero.

parse('ax^2 + bx + c') --> returns an array with a, b, and c which can be directly passed into the ^quadratic function.

Note returns an array with a, b, and c which can be directly passed into the ^quadratic function.

formula for a quadratic

Example:

// source

let eq = 'x^2 - 7x + 12 = 0'

let [a, b, c] = parse(eq)

let ans = quadratic(a, b, c)

console.log(ans) // (x - 3) == 0 || (x - 4) == 0

// looking at the source is a great way to learn quadratics

About

Repository with things related to Algebra and Calculus within Javascript

https://amukh1.dev

License:MIT License


Languages

Language:JavaScript 75.0%Language:Python 20.3%Language:Haskell 4.7%