Python | Numpy np.lagval3d() method

Python | Numpy np.lagval3d() method

The np.lagval3d() function is part of the numpy.polynomial.laguerre module, and it is used to evaluate a 3D Laguerre series at points (x, y, z). It essentially evaluates the Laguerre polynomial over a 3-dimensional grid formed by the Cartesian product of x, y, and z.

Syntax:

numpy.polynomial.laguerre.lagval3d(x, y, z, c) 

Parameters:

  • x, y, z: array_like

    • Three-dimensional arrays of values at which the Laguerre polynomial should be evaluated.
  • c: array_like

    • Array of coefficients ordered so that the terms are taken from low to high degree.

Returns:

  • values: ndarray
    • 3D array of values of the Laguerre polynomial at the input points.

Example:

Let's look at a simple example:

import numpy as np # Sample coefficients for the Laguerre polynomial coefficients = [1, 2, 3] # 3D points x = np.array([0.5, 1.5]) y = np.array([0.5, 1.5]) z = np.array([0.5, 1.5]) # Evaluate the Laguerre polynomial values = np.polynomial.laguerre.lagval3d(x, y, z, coefficients) print(values) 

The above example will return a 3D array containing the values of the Laguerre polynomial (defined by the coefficients) evaluated over the grid formed by x, y, and z.


More Tags

dispatch transformation axios aspen python-import print-preview yup branch xpath-1.0 feign

More Programming Guides

Other Guides

More Programming Examples