Skip to content

The tangent of a polynomial written in JavaScript!

License

Notifications You must be signed in to change notification settings

intfract/polytangent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polytangent

The tangent of a polynomial written in JavaScript!

Usage

The polytan module contains a function that finds the tangent line to a polynomial equation. The function takes an array of coefficients in ascending order and the x-coordinate of the point where the tangent touches the polynomial.

const calculate = require('polytan')

// f(x) = x^2 - 2x + 1
// touching point = (2, f(2))
console.log(calculate([1, -2, 1], 2)) 
// { slope: 2, intercept: -3 }
// g(t) = 2x - 3

Releases

No releases published

Packages

No packages published