Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 1.42 KB

der.md

File metadata and controls

66 lines (44 loc) · 1.42 KB

der

Differentiate a polynomial.

API

Numeric.poly.der(coefficients, order = 1, scale = 1, basis = 'poly')

Applies differentiation repeatedly to reach the order.

  • Parameters:
    • coefficients: Coefficients of the source polynomial
    • order: Number of derivatives to apply
    • scale: Scaling factor applied to each derivative
    • basis: Polynomial basis or axis index
    • level: Axis index when the basis is numeric
  • Returns: Coefficients of the differentiated polynomial
  • NumPy: Covers np.polynomial.polynomial.polyder, np.polynomial.chebyshev.chebder, np.polynomial.legendre.legder, np.polynomial.hermite.hermder, np.polynomial.hermite_e.hermeder, np.polynomial.laguerre.lagder, np.polyder through a single Numerix method.

Examples

Differentiate a polynomial

import Numeric from '@neabyte/numerix'

const coefficients = Numeric.poly.der([1, 2, 3])

console.log(coefficients)
// [2,6]

Take the second derivative

import Numeric from '@neabyte/numerix'

const coefficients = Numeric.poly.der([1, 2, 3], 2)

console.log(coefficients)
// [6]

Scale the derivative

import Numeric from '@neabyte/numerix'

const coefficients = Numeric.poly.der([1, 2, 3], 1, 2)

console.log(coefficients)
// [4,12]

Differentiate a constant polynomial

import Numeric from '@neabyte/numerix'

const coefficients = Numeric.poly.der([5])

console.log(coefficients)
// [0]