[IoId("00000000-b1c0-4a10-9f21-0a1b2c3d4e5f")] public sealed class BlurFunction : FunctionWithCaching

A polyline (strictly increasing x) that is progressively blurred by repeated averaging of vertex y-values with their neighbours. In the joint limit of infinitely dense sampling and infinitely many averaging passes this is the one-dimensional heat equation on the vertex-x domain, so the blurred curve is the diffusion of the polyline towards its steady state.

The amount of blur is controlled by a second Function evaluated in x (default: a constant), clamped to 0 (no blur, the original polyline) .. 1 (full blur). The endpoint y-values are pinned (Dirichlet), so the full-blur steady state is the straight chord between the first and last vertex.

Evaluation is a closed-form eigenmode sum: the polyline is expanded once into a sine series and each mode decays as e^(-(nπ)²·τ), where τ is the dimensionless diffusion time mapped from the blur amount. No dense point cloud is ever materialised.

Constructors

BlurFunction

#
Create a default blur function: a small tent polyline with no blur.
public BlurFunction()

BlurFunction

#
Create a new blur function. The endpoint y-values are always pinned, so full blur converges to the straight chord between the first and last vertex.
public BlurFunction(
points,
Polyline vertices. Sorted left to right internally.
blur
Blur amount as a function of x (null -> no blur). Clamped to 0..1.
)

BlurFunction

#
public BlurFunction(
reader
)

Properties

Blur

#
Gets the blur-controlling function.
public Function Blur { get; }

Derivative

Gets a function which is the derivative of this function. The returned function may be either analytic or approximate.
public sealed override Function Derivative { get; }
inherited fromFunctionWithCaching

Integral

Gets a function which is the indefinite integral of this function. The returned function may be analytic or approximate. Note that numeric approximation of indefinite integrals is a slow and not particularly high quality process.
public sealed override Function Integral { get; }
inherited fromFunctionWithCaching

MaximumX

#
Gets the highest vertex x-coordinate.
public double MaximumX { get; }

MinimumX

#
Gets the lowest vertex x-coordinate.
public double MinimumX { get; }

Nomen

Gets a description of this function.
public sealed override Nomen Nomen { get; }
inherited fromFunctionWithCaching
Function.Nomen

Notation

Gets the notation for this function. Notation is aimed at humans and does not need to return a parseable string.
public override string Notation { get; }
inherited fromFunctionWithCaching

Samples

#
Gets the polyline vertices, sorted left to right.
public Point2d[] Samples { get; }

Ui

#
public override FunctionUi Ui { get; }
Function.Ui

Methods

Asymptotes

Returns an array of *all* the non-vertical asymptotes for this function. This property may return both null and empty arrays, implying no asymptotes. Due to the nature of non-vertical asymptotes, there can only be a finite amount of them.
public virtual Line[] Asymptotes()
inherited fromFunction

AutoCoDomain

Compute the automatic codomain for a given domain.
protected void AutoCoDomain(
x0,
Domain start.
x1,
Domain end.
out double
y0,
Lowest value in codomain.
out double
y1,
Highest value in codomain.
samples = 100
Samples.
)
inherited fromFunction

DomainEstimate

#
public override void DomainEstimate(
out double
x0,
out double
x1,
out double
y0,
out double
y1
)

EmitDerivative

#
protected override Function EmitDerivative()

EmitIntegral

Override this method to provide an analytic indefinite integral.
protected virtual Function EmitIntegral()
inherited fromFunctionWithCaching

Holes

#
Returns a collection of domains for which this function is not defined. This method may return null or an empty array, implying no undefined domains. This method may also return domains outside of the specified interval.
public override Interval[] Holes(
x0,
Lower limit of query domain.
x1
Upper limit of query domain.
)
Function.Holes

Integrate

Evaluate the definite integral between two parameters. Unless a function specifically implements an analytic integral, this value will be approximate. Note to implementer: if you provide an analytic integral via the Function.Integral property, that function will be used to compute an analytic result. There is typically no reason to override this method.
public virtual double Integrate(
x0,
Integral start.
x1
Integral end.
)
inherited fromFunction
Definite integral from x0 to x1.

Poles

Returns an array of all the poles (i.e. vertical asymptotes) within a domain. This method may return both null and empty arrays, implying no poles. Furthermore this method may choose to return poles which fall outside of the given domain.
public virtual Pole[] Poles(
x0,
Lower limit of query domain.
x1
Upper limit of query domain.
)
inherited fromFunction

Store

#
public override void Store(
writer
)

Y

#
public override double Y()
Function.Y

YYYY

Evaluate a large amount of values. Functions may choose to use multiple threads to perform this calculation. This method should not throw, instead every failed evaluation will be represented by a NaN value.
public double[] YYYY(
x
Value to evaluate.
)
inherited fromFunction
Evaluation results. Array will contain double.NaN entries for failed evaluations.