pyoptools.misc.function_2d.poly_r.poly_r_deriv module

class pyoptools.misc.function_2d.poly_r.poly_r_deriv.PolyRDeriv

Bases: Function2D

Class that represents the derivative of a radial polynomial.

This class implements the calculation of the partial derivatives of a radial polynomial with respect to x or y coordinates. A radial polynomial is a polynomial expressed in terms of the radial coordinate r = sqrt(x^2 + y^2).

Parameters:
  • coeff (list) – List of coefficients of the radial polynomial. The i-th element corresponds to the coefficient of r^i.

  • axis (int) – Axis along which to take the derivative. Must be 0 (for x) or 1 (for y).

order

The order of the polynomial (number of coefficients - 1)

Type:

int

axis

Axis along which to take the derivative (0 for x, 1 for y)

Type:

int

_coeff

Eigen vector storing the polynomial coefficients

Type:

VectorXd

eval(x, y)

Evaluate the derivative of the radial polynomial over a grid of points.

Parameters:
  • x (ndarray of shape (n, m)) – Array of x coordinates where to evaluate the derivative. Must be a 2D array of doubles.

  • y (ndarray of shape (n, m)) – Array of y coordinates where to evaluate the derivative. Must be a 2D array of doubles.

Returns:

Array containing the values of the polynomial derivative evaluated at each point (x[i,j], y[i,j]).

Return type:

ndarray of shape (n, m)

Notes

This method calls the C-level eval_cy function for each point in the input arrays. Input arrays must have the same shape.