TriangulatedSurface2D.Gradient Method

Definition

Namespace: Numerics.NET.Curves.Surfaces
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.1.0

Overload List

Gradient(Vector<Double>) Computes the gradient of the surface at the specified point.
Gradient(Double, Double) Computes the gradient of the scalar field at the specified 2D point.
Gradient(ReadOnlySpan<Double>, Span<Double>) Computes the gradient of the scalar field at the specified point.
Gradient(Vector<Double>, Vector<Double>) Computes the gradient of the surface at the specified point.

Gradient(Double, Double)

Computes the gradient of the scalar field at the specified 2D point.
C#
public override (double dx, double dy) Gradient(
	double x,
	double y
)

Parameters

x  Double
The x-coordinate.
y  Double
The y-coordinate.

Return Value

ValueTuple<Double, Double>
A tuple containing the partial derivatives (∂f/∂x, ∂f/∂y).

Remarks

For linear (barycentric) interpolation over triangles, the gradient is constant within each triangle and can be computed directly from the triangle vertices.

For points outside the triangulation, the gradient behavior depends on the extrapolation mode.

Gradient(ReadOnlySpan<Double>, Span<Double>)

Computes the gradient of the scalar field at the specified point.
C#
public override void Gradient(
	ReadOnlySpan<double> point,
	Span<double> result
)

Parameters

point  ReadOnlySpan<Double>
A read-only span representing the coordinates of the point.
result  Span<Double>
A span to receive the gradient vector.

Exceptions

ArgumentException

The length of point is not 2.

-or-

The length of result is not 2.

See Also