yasfpy.functions.legendre_normalized_trigon =========================================== .. py:module:: yasfpy.functions.legendre_normalized_trigon .. autoapi-nested-parse:: Normalized associated Legendre functions (trigonometric form). Provides helpers used in spherical-harmonic related computations. Functions --------- .. autoapisummary:: yasfpy.functions.legendre_normalized_trigon.legendre_normalized_trigon yasfpy.functions.legendre_normalized_trigon.legendre_normalized_trigon_legacy Module Contents --------------- .. py:function:: legendre_normalized_trigon(lmax, x, y = None) Compute the normalized Legendre polynomials of the first kind for trigonometric arguments. :param lmax: The maximum degree of the Legendre polynomials. :type lmax: int :param x: The input array of x-coordinates. :type x: np.ndarray :param y: The input array of y-coordinates. Defaults to None. :type y: np.ndarray, optional :returns: The array of computed Legendre polynomials. :rtype: plm (np.ndarray) .. note:: Base on the celes implementation of [legendre_normalized_trigon.m](https://github.com/disordered-photonics/celes/blob/master/src/mathematics/legendre_normalized_trigon.m){:target="_blank"} .. rubric:: Examples >>> lmax = 2 >>> x = np.array([0, np.pi/4, np.pi/2]) >>> y = np.array([0, 1, 0]) >>> result = legendre_normalized_trigon(lmax, x, y) >>> print(result) array([[[ 0.70710678, 0. , 0. ], [ 0. , 0. , 0. ], [ 0. , 0. , 0. ]], [[ 0. , 0. , 0. ], [ 0. , 0.70710678, 0. ], [ 0. , 0. , 0. ]], [[ 0. , 0. , 0. ], [ 0. , 0. , 0. ], [ 0. , 0. , 0.70710678]]]) .. py:function:: legendre_normalized_trigon_legacy(x, y=None, lmax=4) Calculate the normalized Legendre polynomials for trigonometric functions. :param x: The input variable x. :type x: float or sympy.core.symbol.Symbol :param y: The input variable y. Defaults to None. :type y: float or sympy.core.symbol.Symbol, optional :param lmax: The maximum degree of the Legendre polynomials. Defaults to 4. :type lmax: int, optional :returns: The matrix of Legendre polynomials. :rtype: plm (numpy.ndarray)