UNPKG
theorem.js
Version:
latest (1.2.0)
1.2.0
1.1.0
1.0.1
1.0.0
0.1.0
0.0.2
0.0.1
A Math library for computation in JavaScript
github.com/arguiot/TheoremJS
arguiot/TheoremJS
theorem.js
/
src
/
includes
/
functions
/
math
/
algebra
/
slope.js
8 lines
(7 loc)
•
176 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
slope
(
f, x=
0
, i=
1E-10
) {
const
f1 = f.
core
(x)
const
x1 = x
const
f2 = f.
core
(x + i)
const
x2 = x + i
return
new
BigNumber
(f2).
minus
(f1).
div
(
new
BigNumber
(x2).
minus
(x1)) }