| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/matplotlib/tri/__pycache__/ |
Upload File : |
�
G8�c� � �4 � d Z ddlZddlmZ ddlmZ ddlmZ ddl m
Z
dZ G d� d � Z G d
� de� Z
G d� d
e� Z G d� d� Z G d� d� Z G d� de� Z G d� de� Z G d� de� Z G d� d� Zd"d�Zd� Zd� Zd� Zd� Zd� Zd � Zd!� Zy)#z(
Interpolation inside triangular grids.
� N)�_api)�
Triangulation)� TriFinder)�TriAnalyzer)�TriInterpolator�LinearTriInterpolator�CubicTriInterpolatorc �2 � e Zd ZdZdd�ZdZdZ d d�Zd� Zy)
r am
Abstract base class for classes used to interpolate on a triangular grid.
Derived classes implement the following methods:
- ``__call__(x, y)``,
where x, y are array-like point coordinates of the same shape, and
that returns a masked array of the same shape containing the
interpolated z-values.
- ``gradient(x, y)``,
where x, y are array-like point coordinates of the same
shape, and that returns a list of 2 masked arrays of the same shape
containing the 2 derivatives of the interpolator (derivatives of
interpolated z values with respect to x and y).
Nc � � t j t |�� || _ t j
|� | _ | j j | j j j k7 rt d� �t j t d f|�� |xs | j j � | _ d| _
d| _ d | _ y )N)�
triangulationz=z array must have same length as triangulation x and y arrays)� trifinder� �?)r �check_isinstancer �_triangulation�np�asarray�_z�shape�x�
ValueErrorr �
get_trifinder�
_trifinder�_unit_x�_unit_y�
_tri_renum)�selfr �zr
s �?/usr/lib/python3/dist-packages/matplotlib/tri/triinterpolate.py�__init__zTriInterpolator.__init__! s� � ����m�=�I�+����*�*�Q�-����7�7�=�=�D�/�/�1�1�7�7�7�� -� .�
.�
���y�$�/�9�E�#�J�t�':�':�'H�'H�'J��� ������ ��� a�
Returns a masked array containing interpolated values at the specified
(x, y) points.
Parameters
----------
x, y : array-like
x and y coordinates of the same shape and any number of
dimensions.
Returns
-------
np.ma.array
Masked array of the same shape as *x* and *y*; values corresponding
to (*x*, *y*) points outside of the triangulation are masked out.
a�
Returns a list of 2 masked arrays containing interpolated derivatives
at the specified (x, y) points.
Parameters
----------
x, y : array-like
x and y coordinates of the same shape and any number of
dimensions.
Returns
-------
dzdx, dzdy : np.ma.array
2 masked arrays of the same shape as *x* and *y*; values
corresponding to (x, y) points outside of the triangulation
are masked out.
The first returned array contains the values of
:math:`\frac{\partial z}{\partial x}` and the second those of
:math:`\frac{\partial z}{\partial y}`.
c �� � t j |t j �� }t j |t j �� }|j }|j |j k7 r/t dj |j |j � � �t j |� }t j |� }|| j z }|| j z }t j |� }|�| j ||� }nI|j |k7 r%t dj |j |� � �t j |� }|dk7 } | j �|| }
n| j || }
|| }|| }g }
|D ]� } dddd �| }dd| j z d| j z g| }t j |t j �� }t j || <