Triangulated Surface 2D Class
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0
public sealed class TriangulatedSurface2D : SurfaceRemarks
The TriangulatedSurface2D class performs interpolation on irregularly distributed 2D points by constructing a Delaunay triangulation and using piecewise linear (barycentric) interpolation within each triangle.
Delaunay triangulation: The input points are triangulated using the Delaunay criterion, which maximizes the minimum angle of all triangles and avoids sliver triangles. The triangulation partitions the convex hull of the data points into triangular regions.
Interpolation method: For a query point p inside a triangle with vertices (p₀, p₁, p₂) and corresponding values (z₀, z₁, z₂), the interpolated value is computed using barycentric coordinates:
z(p) = λ₀z₀ + λ₁z₁ + λ₂z₂
where λᵢ are the barycentric coordinates satisfying λ₀ + λ₁ + λ₂ = 1.
Domain and extrapolation: The interpolant is naturally defined only over the triangulation (typically the convex hull of the data points). Query points outside this region are handled according to the ExtrapolationMode parameter:
- Throw: Throws an exception for out-of-domain queries.
- Constant: Returns a fill value (typically NaN) for out-of-domain queries.
- Clamp: Projects the query point to the triangulation boundary and interpolates there.
Performance characteristics:
- Construction: O(N log N) for Delaunay triangulation of N points.
- Evaluation: O(log N) per query using efficient point location in the triangulation.
- The interpolant is continuous but has discontinuous gradients at triangle edges.
Triangulated linear interpolation is well-suited for general 2D scattered data and is commonly used in computer graphics, GIS applications, and terrain modeling. It provides a good balance of smoothness, accuracy, and computational efficiency.
The TriangulatedSurface2D class inherits from Surface and is explicitly 2D-only. Create instances using the ScatteredLinear2DInterpolator factory method.
Properties
Methods
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| Evaluate(Double[]) |
Evaluates the surface at the specified point.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at the specified point.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at the specified coordinates.
(Overrides Surface.Evaluate(ReadOnlySpan<Double>)) |
| Evaluate( |
Evaluates the surface at multiple points specified by a list of vectors.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at multiple points specified by a read-only span of vectors.
(Inherited from Surface) |
| Evaluate( |
Evaluates the surface at multiple points stored in column-major layout.
(Inherited from Surface) |
| Get | Serves as the default hash function. (Inherited from Object) |
| Get | Gets the Type of the current instance. (Inherited from Object) |
| Gradient( |
Computes the gradient of the surface at the specified point.
(Inherited from Surface) |
| Gradient( |
Computes the gradient of the scalar field at the specified 2D point.
(Overrides Surface.Gradient(Double, Double)) |
| Gradient( |
Computes the gradient of the scalar field at the specified point.
(Overrides Surface.Gradient(ReadOnlySpan<Double>, Span<Double>)) |
| Gradient( |
Computes the gradient of the surface at the specified point.
(Inherited from Surface) |
| Gradients( |
Computes the gradients of the surface at multiple points.
(Inherited from Surface) |
| Gradients( |
Computes the gradients of the surface at multiple points.
(Inherited from Surface) |
| Hessian |
Computes the Hessian matrix of the surface at the specified point.
(Inherited from Surface) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |