FunctionSampler
A utility class for creating a visual sampling of a function.
Constructors
FunctionSampler
#Create a new sampler based on an evaluation delegate.
Parameters:
| x0 (double) | Lowest x value for sampling region. |
| x1 (double) | Highest x value for sampling region. |
| y0 (double) | Lowest y value visible within sampling region. |
| y1 (double) | Highest y value visible within sampling region. |
| samples (int) | Number of samples required. This is usually the number of visible pixels. |
| function (Func<double, double>) | Delegate. |
FunctionSampler
#Create a new sampler based on an IFunction.
Parameters:
| x0 (double) | Lowest x value for sampling region. |
| x1 (double) | Highest x value for sampling region. |
| y0 (double) | Lowest y value visible within sampling region. |
| y1 (double) | Highest y value visible within sampling region. |
| samples (int) | Number of samples required. This is usually the number of visible pixels. |
| function (Function) | Function. |
Properties
Level
#Gets the level of sampling density currently available.
Negative or zero means no samples have been computed at all.
A positive integer indices every nth sample has been computed.
Methods
ComputeNextSampling
#Compute the next level sampling density.
Returns: Time it took to compute this sampling. If no additional sampling was performed, this method returns TimeSpan.Zero
GraphSegments
#Iterate over all defined stretches of samples. Think of these as the graph segments.
Returns: A collection of zero or more segments, each containing one or more points.
GraphSegments
#Iterate over all defined stretches of samples. Think of these as the graph segments.
Parameters:
| frame (RectangleF) | Visible frame for mapping the samples into. |
Returns: A collection of zero or more segments, each containing one or more points.